mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 17:53:34 +08:00
GPS Yaw: Always reset Yaw when GPS Yaw fusion is starting
Also avoid fusing fake mag data when an other source of yaw aiding is active, even if in MAG_TYPE_NONE mode.
This commit is contained in:
committed by
Mathieu Bresciani
parent
ff8b5ec69d
commit
3c6790f5d5
+2
-8
@@ -522,20 +522,14 @@ void Ekf::controlGpsFusion()
|
||||
if ((_params.fusion_mode & MASK_USE_GPSYAW)
|
||||
&& ISFINITE(_gps_sample_delayed.yaw)
|
||||
&& _control_status.flags.tilt_align
|
||||
&& (!_control_status.flags.gps_yaw || !_control_status.flags.yaw_align)
|
||||
&& !_control_status.flags.gps_yaw
|
||||
&& !_gps_hgt_intermittent) {
|
||||
|
||||
if (resetGpsAntYaw()) {
|
||||
// flag the yaw as aligned
|
||||
_control_status.flags.yaw_align = true;
|
||||
|
||||
// turn on fusion of external vision yaw measurements and disable all other yaw fusion
|
||||
_control_status.flags.gps_yaw = true;
|
||||
_control_status.flags.ev_yaw = false;
|
||||
_control_status.flags.mag_dec = false;
|
||||
|
||||
stopMagHdgFusion();
|
||||
stopMag3DFusion();
|
||||
startGpsYawFusion();
|
||||
|
||||
ECL_INFO_TIMESTAMPED("starting GPS yaw fusion");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user