diff --git a/libraries/AP_NavEKF/AP_NavEKF.cpp b/libraries/AP_NavEKF/AP_NavEKF.cpp index 6a6c9691c4f75cf6f0d8a7aa846251b10df2b3aa..582506d876e6428e0849a258d811b2bfca83c86a 100644 --- a/libraries/AP_NavEKF/AP_NavEKF.cpp +++ b/libraries/AP_NavEKF/AP_NavEKF.cpp @@ -1928,7 +1928,10 @@ void NavEKF::FuseVelPosNED() // use position data if healthy, timed out, or in constant position mode if (posHealth || posTimeout || constPosMode) { posHealth = true; - posFailTime = imuSampleTime_ms; + // We don't reset the failed time if we are in constant position mode + if (!constPosMode) { + posFailTime = imuSampleTime_ms; + } // if timed out or outside the specified glitch radius, increment the offset applied to GPS data to compensate for large GPS position jumps if (posTimeout || (maxPosInnov2 > sq(float(_gpsGlitchRadiusMax)))) { gpsPosGlitchOffsetNE.x += posInnov[0];