From df3a7d32ea2daed48957f3db97ee5bb601de35bc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 30 May 2019 12:29:21 +1000 Subject: [PATCH] Rover: move common proximity pre-arm checks up --- APMrover2/AP_Arming.cpp | 20 +------------------- APMrover2/AP_Arming.h | 1 - 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/APMrover2/AP_Arming.cpp b/APMrover2/AP_Arming.cpp index 6bc08c669c..2985b9dfcf 100644 --- a/APMrover2/AP_Arming.cpp +++ b/APMrover2/AP_Arming.cpp @@ -92,8 +92,7 @@ bool AP_Arming_Rover::pre_arm_checks(bool report) return (AP_Arming::pre_arm_checks(report) & rover.g2.motors.pre_arm_check(report) - & fence_checks(report) - & proximity_check(report)); + & fence_checks(report)); } bool AP_Arming_Rover::arm_checks(AP_Arming::Method method) @@ -105,23 +104,6 @@ bool AP_Arming_Rover::arm_checks(AP_Arming::Method method) return AP_Arming::arm_checks(method); } -// check nothing is too close to vehicle -bool AP_Arming_Rover::proximity_check(bool report) -{ - // return true immediately if no sensor present - if (rover.g2.proximity.get_status() == AP_Proximity::Proximity_NotConnected) { - return true; - } - - // return false if proximity sensor unhealthy - if (rover.g2.proximity.get_status() < AP_Proximity::Proximity_Good) { - check_failed(ARMING_CHECK_NONE, report, "check proximity sensor"); - return false; - } - - return true; -} - void AP_Arming_Rover::update_soft_armed() { hal.util->set_soft_armed(is_armed() && diff --git a/APMrover2/AP_Arming.h b/APMrover2/AP_Arming.h index e52349cb9b..52306a3374 100644 --- a/APMrover2/AP_Arming.h +++ b/APMrover2/AP_Arming.h @@ -27,7 +27,6 @@ public: void update_soft_armed(); protected: - bool proximity_check(bool report); private: