utra-robosoccer / soccer-embedded

Collection of embedded programs for an autonomous humanoid soccer robot
http://utrahumanoid.ca
32 stars 8 forks source link

IMU data is displayed incorrectly in the PC-side script #198

Closed tygamvrelis closed 5 years ago

tygamvrelis commented 5 years ago

Describe the bug After connecting a MPU6050 to the regression testing setup today, I noticed that the IMU data streamed back is incorrect (Ay, Az were 0, velocity looked like acceleration, and so on).

To Reproduce Steps to reproduce the behavior:

  1. Program Robot_F4 into the F446RE. Make sure a MPU6050 is attached
  2. Run soccer_hardware.py in PC Communication
  3. Observe how the last two rows of acceleration data are stuck at 0, while the topmost row of acceleration and bottom 2 rows of velocity appear sensitive to acceleration. (This suggests an 8-byte offset)

Expected behavior The velocity rows should be sensitive to velocity, and the acceleration rows should be sensitive to acceleration. All should be non-zero, in general, since there is usually noise in the measurements.

Screenshots image

tygamvrelis commented 5 years ago

Traced this back to #193, it looks like the IMU data offset is being applied relative to the start of RobotState, whereas it should be relative to the start of RobotState.msg:

https://github.com/utra-robosoccer/soccer-embedded/pull/193/files#diff-01eb0e78e3d4a62ff629dbaa0854d743R55