AP_Arming: do not wait 10 seconds with single gyro/accel

This commit is contained in:
Maxim Buzdalov 2024-04-01 03:10:26 +01:00 committed by Andrew Tridgell
parent f28cfc9a3b
commit 9978b8f97f
1 changed files with 4 additions and 2 deletions

View File

@ -365,8 +365,9 @@ bool AP_Arming::ins_accels_consistent(const AP_InertialSensor &ins)
last_accel_pass_ms = now;
}
// if accels can in theory be inconsistent,
// must pass for at least 10 seconds before we're considered consistent:
if (now - last_accel_pass_ms < 10000) {
if (ins.get_accel_count() > 1 && now - last_accel_pass_ms < 10000) {
return false;
}
@ -389,8 +390,9 @@ bool AP_Arming::ins_gyros_consistent(const AP_InertialSensor &ins)
last_gyro_pass_ms = now;
}
// if gyros can in theory be inconsistent,
// must pass for at least 10 seconds before we're considered consistent:
if (now - last_gyro_pass_ms < 10000) {
if (ins.get_gyro_count() > 1 && now - last_gyro_pass_ms < 10000) {
return false;
}