mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 12:30:34 +08:00
commander: fix broken 'commander arm/disarm' CLI
Regression from https://github.com/PX4/Firmware/pull/13613. VEHICLE_CMD_COMPONENT_ARM_DISARM from CLI would enter the ARMING_STATE_IN_AIR_RESTORE logic. This was never intended for disarming (and leads to state machine transition failures), and IMO it is also not intended for commands from CLI.
This commit is contained in:
@@ -691,8 +691,11 @@ Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_
|
||||
break;
|
||||
}
|
||||
|
||||
// Flick to inair restore first if this comes from an onboard system
|
||||
if (cmd.source_system == status_local->system_id && cmd.source_component == status_local->component_id) {
|
||||
const bool cmd_from_io = (static_cast<int>(roundf(cmd.param3)) == 1234);
|
||||
|
||||
// Flick to inair restore first if this comes from an onboard system and from IO
|
||||
if (cmd.source_system == status_local->system_id && cmd.source_component == status_local->component_id
|
||||
&& cmd_from_io && cmd_arms) {
|
||||
status.arming_state = vehicle_status_s::ARMING_STATE_IN_AIR_RESTORE;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user