sailing-robot icon indicating copy to clipboard operation
sailing-robot copied to clipboard

IMU pitch offset from boat pitch

Open takluyver opened this issue 8 years ago • 1 comments

The pitch we read from our IMU is about +10 degrees when we consider the boat to be level.

  • Does this matter?
  • Can we fix it in hardware, by positioning the IMU or the brian box better?
  • If not, should we adjust it in software to give a pitch reading for the boat?

takluyver avatar Jul 04 '17 20:07 takluyver

This would depend if you reading euler angles or converting from a quaternion or cosine matrix.

Euler angles have a singularity known as gimbal lock which causes angles to approach infinity when pitch (or the middle angle) approaches 90 deg. You are unlikely to encounter gimbal lock if roll pitch and yaw are aligned with the boat axis unless you nose dive. If they are not you will start getting odd angles as the IMU algorithm will usually prevent the angle from displaying over 180 deg.

If you are using DCM or quats best practise is to 'subtract' (actually divide) the reference orientation (level facing north) before convert to euler angles in roll-pitch-yaw order to avoid gimble lock.

I hope this is useful.

Josh

joshctaylor avatar Jul 22 '17 21:07 joshctaylor