Skip to content

Commit

Permalink
commander: fix potentially wrong user message
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed May 19, 2021
1 parent c7215bc commit 033a0b9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/commander/Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,13 @@ Commander::handle_command(const vehicle_command_s &cmd)
const bool cmd_from_io = (static_cast<int>(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;
}
Expand Down

0 comments on commit 033a0b9

Please sign in to comment.