paparazzi/paparazzi — Issue #93: proper handling of BODY_TO_IMU in all AHRS algos
Author: flixr
Created: 2011-11-28 18:56:51+00:00
State: open

Currently you can't really use IMU_TO_BODY to set a totally different
orientation, only to correct for small errors.

e.g. for ahrs_float_dcm:

> I solved the problem... There is a small bug in the DCM body-to-IMU
> rotation implementation, when the USE_GPS flag is enabled. The GPS heading
> (which is obviously not dependent on the orientation of the IMU) is
> incorporated into the state matrix, before it is rotated as defined by the
> body-to-IMU variables... This of course results in an error in the reported
> heading.

Was very briefly discussed already a while ago:
http://lists.gnu.org/archive/html/paparazzi-devel/2011-10/msg00021.html

> My quick solution was to add IMU_BODY_TO_IMU_PSI to the ground_course, to
> compensate for it later being subtracted by the body-to-IMU rotation:
> float ground_course = ((float)gps.course)/1.e7 - M_PI + IMU_BODY_TO_IMU_PSI;

This only solves part of the problem, e.g. in ahrs_update_accel the
correction of centrifugal force is not correct if the imu is not
aligned with the body.
Also that quick solution only works if BODY_TO_IMU doesn't have any
significant rotation on phi and theta.

This can all be fixed of course, but I guess the question still is
whether to run the ahrs in body or in imu frame, both has it's
advantages and drawbacks....