Copter: tidy use 'else if' to avoid unnecessary complication in location arm checks

This commit is contained in:
Peter Barker 2024-06-19 13:36:20 +10:00 committed by Peter Barker
parent b86094978d
commit e34c91d1aa
1 changed files with 8 additions and 10 deletions

View File

@ -450,8 +450,7 @@ bool AP_Arming_Copter::mandatory_gps_checks(bool display_failure)
check_failed(display_failure, "Need Position Estimate");
return false;
}
} else {
if (fence_requires_gps) {
} else if (fence_requires_gps) {
if (!copter.position_ok()) {
// clarify to user why they need GPS in non-GPS flight mode
check_failed(display_failure, "Fence enabled, need position estimate");
@ -461,7 +460,6 @@ bool AP_Arming_Copter::mandatory_gps_checks(bool display_failure)
// return true if GPS is not required
return true;
}
}
// check for GPS glitch (as reported by EKF)
nav_filter_status filt_status;