mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 17:07:34 +08:00
EKF: Don't fuse heading if FW and waiting for mag states to stabilise
Doing so is a bad idea because bad mag data can drag the yaw angle away from the reset value and lead to rejection of GPS.
This commit is contained in:
+2
-2
@@ -483,7 +483,7 @@ void Ekf::controlGpsFusion()
|
||||
do_reset = do_reset || (_time_last_imu - _time_last_pos_fuse > 2 * _params.no_gps_timeout_max);
|
||||
|
||||
if (do_reset) {
|
||||
// use GPS velocity data to cehck and correct yaw angle if a FW vehicle
|
||||
// use GPS velocity data to check and correct yaw angle if a FW vehicle
|
||||
if (_control_status.flags.fixed_wing && _control_status.flags.in_air) {
|
||||
// if flying a fixed wing aircraft, do a complete reset that includes yaw
|
||||
realignYawGPS();
|
||||
@@ -1296,7 +1296,7 @@ void Ekf::controlMagFusion()
|
||||
fuseDeclination();
|
||||
}
|
||||
|
||||
if (_flt_mag_align_converging) {
|
||||
if (_flt_mag_align_converging && !_control_status.flags.fixed_wing) {
|
||||
_control_status.flags.mag_hdg = true;
|
||||
fuseHeading();
|
||||
_control_status.flags.mag_hdg = false;
|
||||
|
||||
Reference in New Issue
Block a user