MB3hel / AUVControlBoard

Vectored 6-DOF motion controller for AUVs.
https://mb3hel.github.io/AUVControlBoard/
1 stars 2 forks source link

[BUG] Sensor Data is sometimes all zero #18

Closed MB3hel closed 1 year ago

MB3hel commented 1 year ago

Describe the bug Sometimes, when running the sensordata.py script, the data is all zeros. Re-launching the script seems to fix the error. This certainly happens with the IMU. I don't recall if it also impacts the depth sensor when this occurs.

My current theory is that the axis configure is somehow related since re-launching the script fixes the issue. That is really the only major config change that re-launching the script would cause.

Tested Versions v1, v2

Impacted Versions v1, v2

To Reproduce Steps to reproduce the behavior (INCLUDE WHAT BUILD CONFIGURATION USED):

  1. Build Debug for v1 or v2 (other build configs not tested)
  2. Flash the board
  3. Run the sensordata.py script
  4. See if IMU data is all zeros. If not, re-launch sensordata script until it is.

Expected behavior IMU data is not zero

MB3hel commented 1 year ago

Likely fixed by 771118a5e1df272cff5b6d278051f65121fe0f7c. Will do some more testing and close if no longer reproducible.

MB3hel commented 1 year ago

Has occurred again despite this change. Other options need to be explored.

MB3hel commented 1 year ago

This was likely caused by a race condition for using the bno055's i2c_transaction instance. During axis configuration both the cmdctrl thread and the bno055 thread could simultaneously alter the transaction (only the i2c perform was mutexed).

This has been fixed on feature/sensorcal and should not be a problem in the next release.