Commander: make sure unsupported do reposition command result is published

todo: need to consolidate the command ack strategy in this function
This commit is contained in:
Thomas Stastny 2023-09-13 19:20:53 +02:00 committed by Daniel Agar
parent bec0d83cf4
commit a1cd4fd5df

View File

@ -724,7 +724,7 @@ Commander::handle_command(const vehicle_command_s &cmd)
const bool unsupported_bits_set = (change_mode_flags & ~1) != 0;
if (mode_switch_not_requested || unsupported_bits_set) {
cmd_result = vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED;
answer_command(cmd, vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED);
} else {
if (_user_mode_intention.change(vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER)) {