From d1feb93152497bdef11aff2c17dbcd9c4331ee6a Mon Sep 17 00:00:00 2001 From: Matt Lawrence Date: Wed, 15 Jan 2020 17:30:46 -0500 Subject: [PATCH] Copter: Add GCS failsafe pre-arm check --- ArduCopter/AP_Arming.cpp | 12 +++++++++++- ArduCopter/AP_Arming.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ArduCopter/AP_Arming.cpp b/ArduCopter/AP_Arming.cpp index 88bf7147fa..1e721e47ba 100644 --- a/ArduCopter/AP_Arming.cpp +++ b/ArduCopter/AP_Arming.cpp @@ -60,7 +60,8 @@ bool AP_Arming_Copter::run_pre_arm_checks(bool display_failure) & parameter_checks(display_failure) & motor_checks(display_failure) & pilot_throttle_checks(display_failure) - & oa_checks(display_failure) & + & oa_checks(display_failure) + & gcs_failsafe_check(display_failure) & AP_Arming::pre_arm_checks(display_failure); } @@ -563,6 +564,15 @@ bool AP_Arming_Copter::mandatory_gps_checks(bool display_failure) return true; } +// Check GCS failsafe +bool AP_Arming_Copter::gcs_failsafe_check(bool display_failure) +{ + if (copter.failsafe.gcs) { + check_failed(display_failure, "GCS failsafe on"); + return false; + } + return true; +} // arm_checks - perform final checks before arming // always called just before arming. Return true if ok to arm diff --git a/ArduCopter/AP_Arming.h b/ArduCopter/AP_Arming.h index 852acb6e6a..99807fd50c 100644 --- a/ArduCopter/AP_Arming.h +++ b/ArduCopter/AP_Arming.h @@ -49,6 +49,7 @@ protected: bool pilot_throttle_checks(bool display_failure); bool oa_checks(bool display_failure); bool mandatory_gps_checks(bool display_failure); + bool gcs_failsafe_check(bool display_failure); void set_pre_arm_check(bool b);