diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp index fff4e809a3..ba9b2e51c3 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp @@ -693,7 +693,7 @@ void NavEKF3_core::FuseVelPosNED() } else { goodIMUdata_ms = imuSampleTime_ms; } - if (imuSampleTime_ms - badIMUdata_ms < 10000) { + if (imuSampleTime_ms - badIMUdata_ms < BAD_IMU_DATA_HOLD_MS) { badIMUdata = true; } else { badIMUdata = false; diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_core.h b/libraries/AP_NavEKF3/AP_NavEKF3_core.h index 6580a62da9..d0b8814ac7 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_core.h +++ b/libraries/AP_NavEKF3/AP_NavEKF3_core.h @@ -102,6 +102,9 @@ // Number of milliseconds of bad IMU data before a reset to vertical position and velocity height sources is performed #define BAD_IMU_DATA_TIMEOUT_MS 1000 +// number of milliseconds the bad IMU data response settings will be held after the last bad IMU data is detected +#define BAD_IMU_DATA_HOLD_MS 10000 + class NavEKF3_core : public NavEKF_core_common { public: