Browse Source

commander: fix potentially wrong user message

master
Julian Oes 4 years ago committed by Matthias Grob
parent
commit
5ae76bdc17
  1. 8
      src/modules/commander/Commander.cpp

8
src/modules/commander/Commander.cpp

@ -928,7 +928,13 @@ Commander::handle_command(const vehicle_command_s &cmd)
const bool cmd_from_io = (static_cast<int>(roundf(cmd.param3)) == 1234); const bool cmd_from_io = (static_cast<int>(roundf(cmd.param3)) == 1234);
if (cmd_from_manual_stick && !_vehicle_control_mode.flag_control_manual_enabled) { 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; cmd_result = vehicle_command_s::VEHICLE_CMD_RESULT_DENIED;
break; break;
} }

Loading…
Cancel
Save