Skip to content

Commit

Permalink
AP_NavEKF3: Use a smaller airspeed observation gate when dead reckoning
Browse files Browse the repository at this point in the history
  • Loading branch information
priseborough authored and tridge committed Sep 30, 2023
1 parent cab795d commit c5782cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/AP_NavEKF3/AP_NavEKF3_AirDataFusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ void NavEKF3_core::FuseAirspeed()
// When dead reckoning, scale up innovation variance if innovations are larger than the gate
// and do not reject the observation to reduce the impact of bad airspeed data or sudden
// wind speed changes on the ability to continue dead reckoning navigation.
tasTestRatio = sq(innovVtas) / (sq(MAX(0.01f * (ftype)frontend->_tasInnovGate, 1.0f)) * varInnovVtas);
const bool doingAirDataDeadReckoning = posTimeout || (PV_AidingMode != AID_ABSOLUTE);
// Use a smaller gate when dead reckoning to prevent rapid changes to velocity states
// due to gusts or airspeed errors.
const ftype gateStdDev = doingAirDataDeadReckoning ? 1.0f : MAX(0.01f * (ftype)frontend->_tasInnovGate, 1.0f);
tasTestRatio = sq(innovVtas) / (sq(gateStdDev) * varInnovVtas);
if (doingAirDataDeadReckoning && tasTestRatio > 1.0f) {
// Adjust the Kalman gains equivalent to increasing the observation noise variance to the
// smallest value that would result in the observation being accepted.
Expand Down

0 comments on commit c5782cd

Please sign in to comment.