From f4df3fb5f2d8d7df369da58be422bc2cfffebe36 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Fri, 17 Jan 2020 19:45:03 +0100 Subject: [PATCH] pre arm check: VTOL: do not allow arming if not in multicopter mode Signed-off-by: Silvan Fuhrer --- .../commander/Arming/PreFlightCheck/checks/preArmCheck.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/commander/Arming/PreFlightCheck/checks/preArmCheck.cpp b/src/modules/commander/Arming/PreFlightCheck/checks/preArmCheck.cpp index ce74c4b649..261fc5abea 100644 --- a/src/modules/commander/Arming/PreFlightCheck/checks/preArmCheck.cpp +++ b/src/modules/commander/Arming/PreFlightCheck/checks/preArmCheck.cpp @@ -134,6 +134,13 @@ bool PreFlightCheck::preArmCheck(orb_advert_t *mavlink_log_pub, const vehicle_st } } + if (status.is_vtol && status.vehicle_type != vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) { + if (prearm_ok) { + mavlink_log_critical(mavlink_log_pub, "Arming denied! Vehicle is not in multicopter mode"); + prearm_ok = false; + } + } + // Arm Requirements: authorization // check last, and only if everything else has passed if (arm_requirements.arm_authorization && prearm_ok) {