-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IMU timeout detection to SoftFusionSensor
#376
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I've been getting random timeouts of both sensors at the same time every once in a while, which makes sense considering that |
Not sure if it fixes it, everything is an uint, so it will wrap around when you subtract. Personally I'd switch to millis instead of micros, that has a wraparound of about 50 days, and it's not like you need the accuracy of micros. |
This reverts commit f4c2835.
Should be good now |
Would it not better to fix that here https://github.com/SlimeVR/SlimeVR-Tracker-ESP/blob/main/src/sensors/softfusion/softfusionsensor.h#L231 ? edit: nvm. A different case. It may take longer every turnover (~1.1h) to drop 1 sending of data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it does matter. Else it looks good to me.
@@ -67,4 +67,8 @@ | |||
#define PACKET_INSPECTION_DATATYPE_INT 1 | |||
#define PACKET_INSPECTION_DATATYPE_FLOAT 2 | |||
|
|||
enum class PacketErrorCode : uint8_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems not to be defined till now. On BNO it sends the following.
https://github.com/SlimeVR/SlimeVR-Tracker-ESP/blob/main/src/sensors/bno080sensor.cpp#L220-L223
//Get the reason for the last reset
//1 = POR, 2 = Internal reset, 3 = Watchdog, 4 = External reset, 5 = Other
Adds IMU timeout detection: sends an error and changes status if no data received for more than 2 seconds. Copypasted from ICM20948 code, tested with LSM6DSO.