mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 03:43:35 +08:00
EKF: Ensure normal yaw alignment using mag is performed if GPS method is not
This commit is contained in:
committed by
Lorenz Meier
parent
d446f66105
commit
ec2b54fde7
+4
-4
@@ -1050,7 +1050,7 @@ void Ekf::controlMagFusion()
|
||||
if (!_control_status.flags.mag_3D) {
|
||||
if (!_flt_mag_align_complete) {
|
||||
// If we are flying a vehicle that flies forward, eg plane, then we can use the GPS course to check and correct the heading
|
||||
if (_control_status.flags.fixed_wing) {
|
||||
if (_control_status.flags.fixed_wing && _control_status.flags.in_air) {
|
||||
_control_status.flags.yaw_align = realignYawGPS();
|
||||
_flt_mag_align_complete = _control_status.flags.yaw_align;
|
||||
} else {
|
||||
@@ -1069,9 +1069,9 @@ void Ekf::controlMagFusion()
|
||||
}
|
||||
}
|
||||
|
||||
// use 3D mag fusion when airborne
|
||||
_control_status.flags.mag_hdg = false;
|
||||
_control_status.flags.mag_3D = true;
|
||||
// only use one type of mag fusion at the same time
|
||||
_control_status.flags.mag_3D = _flt_mag_align_complete;
|
||||
_control_status.flags.mag_hdg = !_control_status.flags.mag_3D;
|
||||
|
||||
} else {
|
||||
// save magnetic field state variances for next time
|
||||
|
||||
Reference in New Issue
Block a user