Skip to content

Commit

Permalink
AP_Arming: do not wait 10 seconds with single gyro/accel
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuzdalov authored and tridge committed Apr 2, 2024
1 parent f28cfc9 commit 9978b8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/AP_Arming/AP_Arming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 9978b8f

Please sign in to comment.