AP_Arming: guard IMU consistency window so the macro can be set to 0

This commit is contained in:
rishabsingh3003
2026-05-12 09:34:22 +10:00
committed by Peter Barker
parent 32feaac515
commit ef884af3f1
+5 -1
View File
@@ -475,9 +475,11 @@ bool AP_Arming::ins_accels_consistent(const AP_InertialSensor &ins)
// if accels can in theory be inconsistent,
// must pass for at least AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS ms before we're considered consistent:
#if AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS > 0
if (ins.get_accel_count() > 1 && now - last_accel_pass_ms < AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS) {
return false;
}
#endif
return true;
}
@@ -500,9 +502,11 @@ bool AP_Arming::ins_gyros_consistent(const AP_InertialSensor &ins)
// if gyros can in theory be inconsistent,
// must pass for at least AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS ms before we're considered consistent:
if (ins.get_gyro_count() > 1 && now - last_gyro_pass_ms < AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS) {
#if AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS > 0
if (ins.get_gyro_count() > 1 && now - last_gyro_pass_ms < AP_ARMING_IMU_CONSISTENCY_CHECK_TIME_MS) {
return false;
}
#endif
return true;
}