From bf0e7fb3a9331dd67a5ae941a59f6993ff6de168 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 1 Nov 2016 16:11:07 +0900 Subject: [PATCH] Copter: add compass health to arming check --- ArduCopter/arming_checks.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArduCopter/arming_checks.cpp b/ArduCopter/arming_checks.cpp index ba9400ecc3..8a7d25700c 100644 --- a/ArduCopter/arming_checks.cpp +++ b/ArduCopter/arming_checks.cpp @@ -656,6 +656,14 @@ bool Copter::arm_checks(bool display_failure, bool arming_from_gcs) return false; } + // check compass health + if (!compass.healthy()) { + if (display_failure) { + gcs_send_text(MAV_SEVERITY_CRITICAL,"Arm: Compass not healthy"); + } + return false; + } + if (compass.is_calibrating()) { if (display_failure) { gcs_send_text(MAV_SEVERITY_CRITICAL,"Arm: Compass calibration running");