Synopsis
void ahrs_set_feedback(AHRS_STATE_t *self,
                       float feedback);
Description

ahrs_set_feedback sets the long-term feedback factor, to correct the estimated orientation from the magnetometer and accelerometers.

The feedback factor feedback should be a value in the range from 0.0 to 0.5. With a factor of zero, any magnetometer and accelerometer data presented using ahrs_update is ignored and only the gyroscope data used to update the orientation estimation. In this case, there is no correction for long-term drift.

The feedback factor is set to 0.1 by the initialization functions.

Larger values of the feedback factor will make the initial orientation estimation converge faster to a fixed state. We have found that it is best to set the feedback factor to 0.3 for the first 200 samples or so, to quickly estimate orientation from the accelerometer and magnetometer, and then set the feedback factor to 0.1 for subsequent samples.

Thread Safety

ahrs_set_feedback is thread safe.