From dbbf6cae5c6f5e534a4901f72c647d953b83d5f8 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 20 Dec 2016 15:06:22 +0900 Subject: [PATCH] Copter: arming check ignores proximity if avoidance disabled --- ArduCopter/arming_checks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduCopter/arming_checks.cpp b/ArduCopter/arming_checks.cpp index 26816c3669..b4f31c60a2 100644 --- a/ArduCopter/arming_checks.cpp +++ b/ArduCopter/arming_checks.cpp @@ -620,9 +620,9 @@ bool Copter::pre_arm_proximity_check(bool display_failure) return false; } - // get closest object + // get closest object if we might use it for avoidance float angle_deg, distance; - if (g2.proximity.get_closest_object(angle_deg, distance)) { + if (avoid.proximity_avoidance_enabled() && g2.proximity.get_closest_object(angle_deg, distance)) { // display error if something is within 60cm if (distance <= 0.6f) { if (display_failure) {