AHRS using complementary filter in fixed point. Propagation is done in quaternion representation. By default uses magnetometer for heading for rotorcrafts. For fixedwing firmware AHRS_GRAVITY_UPDATE_COORDINATED_TURN is enabled by default and magnetometer disabled (needs GPS). To measure attitude angles, gyrometers measurements are integrated. The result of integration is accurate for short term, but gyro bias is accumulated, which results in long term errors (drift). On the other hand, accelerometers can be used to infer pitch/roll angles utilizing gravity vector measurement, but they suffer from noise due to vibrations. The measurement is then only accurate when averaged over a long term. Also, accelerometers alone are unable to give accurate angles when the vehicle is accelerating. Complementary filter takes advantage of both sensors, using a low-pass filter on accelerometer readings and high pass filter on gyrometers readings, to estimate attitude angles. - No danger of gimbal lock, since quaternions are used. - The arithmetic is fixed point and is thus suitable if the processor (on your board) has no FPU. - Estimates the gyro bias. ahrs_common,@imu,@mag|@gps ahrs