From 5ae76bdc17c46bd2c03a970afb3c47b44ebff496 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 18 May 2021 12:58:30 +0200 Subject: [PATCH] commander: fix potentially wrong user message --- src/modules/commander/Commander.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index cf07e308a2..1fb0f6d0e9 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -928,7 +928,13 @@ Commander::handle_command(const vehicle_command_s &cmd) const bool cmd_from_io = (static_cast(roundf(cmd.param3)) == 1234); if (cmd_from_manual_stick && !_vehicle_control_mode.flag_control_manual_enabled) { - mavlink_log_critical(&_mavlink_log_pub, "Not arming! Switch to a manual mode first"); + if (param1_arm == 1) { + mavlink_log_critical(&_mavlink_log_pub, "Not arming! Switch to a manual mode first"); + + } else if (param1_arm == 0) { + mavlink_log_critical(&_mavlink_log_pub, "Not disarming! Switch to a manual mode first"); + } + cmd_result = vehicle_command_s::VEHICLE_CMD_RESULT_DENIED; break; }