|
|
|
@ -165,12 +165,11 @@ void Ekf::fuseMag()
@@ -165,12 +165,11 @@ void Ekf::fuseMag()
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
When flying as a fixed wing aircraft, a misaligned magnetometer can cause an error in pitch/roll and accel bias estimates. |
|
|
|
|
When MAG_FUSE_TYPE_AUTOFW is selected and the vehicle is flying as a fixed wing as detected by the use of wind estimation |
|
|
|
|
and current airspeed estimates, then magnetometer fusion is only allowed to access the magnetic field states. |
|
|
|
|
When MAG_FUSE_TYPE_AUTOFW is selected and the vehicle is flying as a fixed wing, then magnetometer fusion is only allowed |
|
|
|
|
to access the magnetic field states. |
|
|
|
|
*/ |
|
|
|
|
_control_status.flags.update_mag_states_only = (_params.mag_fusion_type == MAG_FUSE_TYPE_AUTOFW) |
|
|
|
|
&& _control_status.flags.wind |
|
|
|
|
&& (_time_last_imu - _time_last_airspeed < 1E7); |
|
|
|
|
&& _control_status.flags.fixed_wing; |
|
|
|
|
|
|
|
|
|
// update the states and covariance using sequential fusion of the magnetometer components
|
|
|
|
|
for (uint8_t index = 0; index <= 2; index++) { |
|
|
|
|