mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(ekf2): use HAGL validity for range height ref
This commit is contained in:
1 parent
cac770e333
commit
48bc4a8576
1 file changed
+2
-1
@@ -380,7 +380,8 @@ bool Ekf::checkHaglYawResetReq() const
|
||||
// Check if height has increased sufficiently to be away from ground magnetic anomalies
|
||||
// and request a yaw reset if not already requested.
|
||||
static constexpr float mag_anomalies_max_hagl = 1.5f;
|
||||
return isHeightAboveGroundEstimateValid() && (getHagl() > mag_anomalies_max_hagl);
|
||||
const bool above_mag_anomalies = (getTerrainVPos() + _gpos.altitude()) > mag_anomalies_max_hagl;
|
||||
return above_mag_anomalies;
|
||||
}
|
||||
|
||||
#endif // CONFIG_EKF2_TERRAIN
|
||||
|
||||
Reference in new issue
Block a user