mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 09:58:28 -04:00
AP_NavEKF: don't run when previously disarmed and time has slipped
This commit is contained in:
parent
085faaac6a
commit
10476333d8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user