mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 02:23:34 +08:00
EKF: Don't use magnetometer with optical flow only nav if GPS checks are failing
This commit is contained in:
committed by
Lorenz Meier
parent
84516760c0
commit
0160aaa568
+7
-1
@@ -675,7 +675,13 @@ void Ekf::fuseHeading()
|
||||
measured_hdg = wrap_pi(measured_hdg);
|
||||
|
||||
// calculate the innovation
|
||||
_heading_innov = predicted_hdg - measured_hdg;
|
||||
if (_mag_use_inhibit) {
|
||||
// The magnetomer cannot be trusted but we need to fuse a heading to prevent a badly
|
||||
// conditoned covariance matrix developing over time.
|
||||
_heading_innov = 0.0f;
|
||||
} else {
|
||||
_heading_innov = predicted_hdg - measured_hdg;
|
||||
}
|
||||
|
||||
// wrap the innovation to the interval between +-pi
|
||||
_heading_innov = wrap_pi(_heading_innov);
|
||||
|
||||
Reference in New Issue
Block a user