AP_NavEKF: don't run when previously disarmed and time has slipped

This commit is contained in:
Jonathan Challinger 2015-04-16 18:50:14 -07:00 committed by Randy Mackay
parent 085faaac6a
commit 10476333d8

View File

@ -699,6 +699,19 @@ void NavEKF::UpdateFilter()
// read IMU data and convert to delta angles and velocities
readIMUData();
static bool prev_armed = false;
bool armed = getVehicleArmStatus();
// the vehicle was previously disarmed and time has slipped
// gyro auto-zero has likely just been done - skip this timestep
if (!prev_armed && dtIMUactual > dtIMUavg*5.0f) {
// stop the timer used for load measurement
perf_end(_perf_UpdateFilter);
prev_armed = armed;
return;
}
prev_armed = armed;
// detect if the filter update has been delayed for too long
if (dtIMUactual > 0.2f) {
// we have stalled for too long - reset states