mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
EKF: Add simple control logic for magnetic declination constraint
This commit is contained in:
parent
dbb8e12948
commit
cdc42c1de0
@ -109,6 +109,13 @@ void Ekf::controlFusionModes()
|
||||
_control_status.flags.mag_3D = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
_control_status.flags.mag_dec = false;
|
||||
} else {
|
||||
_control_status.flags.mag_dec = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Ekf::calculateVehicleStatus()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user