Browse Source

AP_NavEKF : fixed bug in pos and vel reset when in static mode

master
Paul Riseborough 11 years ago committed by Andrew Tridgell
parent
commit
7a82746fcc
  1. 14
      libraries/AP_NavEKF/AP_NavEKF.cpp

14
libraries/AP_NavEKF/AP_NavEKF.cpp

@ -557,8 +557,10 @@ void NavEKF::SelectVelPosFusion() @@ -557,8 +557,10 @@ void NavEKF::SelectVelPosFusion()
skipCounter = velPosFuseStepRatio;
// If a long time sinc last GPS update, then reset position and velocity
if ((hal.scheduler->millis() > secondLastFixTime_ms + _gpsRetryTimeUseTAS && useAirspeed) || (hal.scheduler->millis() > secondLastFixTime_ms + _gpsRetryTimeNoTAS && !useAirspeed)) {
ResetPosition();
ResetVelocity();
if (!staticMode) {
ResetPosition();
ResetVelocity();
}
}
}
@ -1515,7 +1517,9 @@ void NavEKF::FuseVelPosNED() @@ -1515,7 +1517,9 @@ void NavEKF::FuseVelPosNED()
velFailTime = hal.scheduler->millis();
if (velTimeout)
{
ResetVelocity();
if (!staticMode) {
ResetVelocity();
}
fuseVelData = false;
}
@ -1541,7 +1545,9 @@ void NavEKF::FuseVelPosNED() @@ -1541,7 +1545,9 @@ void NavEKF::FuseVelPosNED()
posFailTime = hal.scheduler->millis();
if (posTimeout)
{
ResetPosition();
if (!staticMode) {
ResetPosition();
}
fusePosData = false;
}
}

Loading…
Cancel
Save