EKF: Don't do magnetic field estimation without earth frame measurements

Use horizontal acceleration to check if yaw is observable independent of the magnetometer.
Use rotation about the vertical to check if mag raises are observable.
If neither yaw of mag biases are observable, save the magnetic field variances and switch to magnetic yaw fusion.
Use the last learned declination when using magnetic yaw fusion so that the yaw reference remains consistent.
When yaw or biases become observable, reinstate the saved variances and switch back to 3D mag fusion.
This commit is contained in:
Paul Riseborough
2017-05-17 08:59:01 +02:00
committed by Lorenz Meier
parent 20db74eca8
commit 394dd95cba
6 changed files with 105 additions and 22 deletions
+2
View File
@@ -230,6 +230,8 @@ struct parameters {
float mag_innov_gate{3.0f}; // magnetometer fusion innovation consistency gate size (STD)
int mag_declination_source{7}; // bitmask used to control the handling of declination data
int mag_fusion_type{0}; // integer used to specify the type of magnetometer fusion used
float mag_acc_gate{0.5f}; // when in auto select mode, heading fusion will be used when manoeuvre accel is lower than this (m/s**2)
float mag_yaw_rate_gate{0.25f}; // yaw rate threshold used by mode select logic (rad/sec)
// airspeed fusion
float tas_innov_gate{5.0f}; // True Airspeed Innovation consistency gate size in standard deciation