From 68da3a123c010b0df9e45d88745fb48cbc980d45 Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Sun, 22 Apr 2018 11:37:03 -0400 Subject: [PATCH] Sub: add armed check to preflight baro calibration This check was lost in 05ee33d! --- ArduSub/GCS_Mavlink.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArduSub/GCS_Mavlink.cpp b/ArduSub/GCS_Mavlink.cpp index b76bd6f12b..c4cdc75ba2 100644 --- a/ArduSub/GCS_Mavlink.cpp +++ b/ArduSub/GCS_Mavlink.cpp @@ -872,6 +872,11 @@ void GCS_MAVLINK_Sub::handle_change_alt_request(AP_Mission::Mission_Command &cmd MAV_RESULT GCS_MAVLINK_Sub::_handle_command_preflight_calibration_baro() { + if (sub.motors.armed()) { + gcs().send_text(MAV_SEVERITY_INFO, "Disarm before calibration."); + return MAV_RESULT_FAILED; + } + if (!sub.control_check_barometer()) { return MAV_RESULT_FAILED; }