mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 22:37:35 +08:00
EKF: Ensure yaw gets reset when declination is set
This commit is contained in:
committed by
Paul Riseborough
parent
68a3cbc368
commit
4657a9cd21
@@ -1356,6 +1356,13 @@ void Ekf::controlMagFusion()
|
||||
// check for new magnetometer data that has fallen behind the fusion time horizon
|
||||
// If we are using external vision data for heading then no magnetometer fusion is used
|
||||
if (!_control_status.flags.ev_yaw && _mag_data_ready) {
|
||||
// perform a yaw reset if requested by other functions
|
||||
if (_mag_yaw_reset_req) {
|
||||
if (!_mag_use_inhibit ) {
|
||||
resetMagHeading(_mag_sample_delayed.mag);
|
||||
}
|
||||
_mag_yaw_reset_req = false;
|
||||
}
|
||||
|
||||
// Determine if we should use simple magnetic heading fusion which works better when there are large external disturbances
|
||||
// or the more accurate 3-axis fusion
|
||||
|
||||
Reference in New Issue
Block a user