mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 02:21:36 +08:00
EKF: Update declination fusion logic
We do not need to run declination fusion if 3-axis mag fusion is not being used.
This commit is contained in:
+3
-3
@@ -111,11 +111,11 @@ void Ekf::controlFusionModes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if we are using 3-axis magnetometer fusion, but without external aiding, then the declination needs to be fused as an observation to prevent long term heading drift
|
// if we are using 3-axis magnetometer fusion, but without external aiding, then the declination needs to be fused as an observation to prevent long term heading drift
|
||||||
if (_control_status.flags.mag_3D && _control_status.flags.gps) {
|
if (_control_status.flags.mag_3D && !_control_status.flags.gps) {
|
||||||
_control_status.flags.mag_dec = false;
|
_control_status.flags.mag_dec = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_control_status.flags.mag_dec = true;
|
_control_status.flags.mag_dec = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user