mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_NavEKF3: Fix bug causing too frequent resets if bad IMU data detected
This commit is contained in:
parent
f0efc1300e
commit
17c2ba5ac1
@ -1220,11 +1220,13 @@ void NavEKF3_core::selectHeightForFusion()
|
||||
ResetPositionD(-hgtMea);
|
||||
}
|
||||
|
||||
// If we haven't fused height data for a while, then declare the height data as being timed out
|
||||
// set timeout period based on whether we have vertical GPS velocity available to constrain drift
|
||||
// If we haven't fused height data for a while or have bad IMU data, then declare the height data as being timed out
|
||||
// set height timeout period based on whether we have vertical GPS velocity available to constrain drift
|
||||
hgtRetryTime_ms = ((useGpsVertVel || useExtNavVel) && !velTimeout) ? frontend->hgtRetryTimeMode0_ms : frontend->hgtRetryTimeMode12_ms;
|
||||
if (imuSampleTime_ms - lastHgtPassTime_ms > hgtRetryTime_ms ||
|
||||
(badIMUdata && (imuSampleTime_ms - goodIMUdata_ms < BAD_IMU_DATA_TIMEOUT_MS))) {
|
||||
(badIMUdata &&
|
||||
(imuSampleTime_ms - goodIMUdata_ms > BAD_IMU_DATA_TIMEOUT_MS) &&
|
||||
(imuSampleTime_ms - lastPosResetD_ms > BAD_IMU_DATA_TIMEOUT_MS))) {
|
||||
hgtTimeout = true;
|
||||
} else {
|
||||
hgtTimeout = false;
|
||||
|
Loading…
Reference in New Issue
Block a user