Tracker: accept arm/disarm to any component ID, not just MAV_COMP_ID_SYSTEM_CONTROL

This commit is contained in:
Peter Barker 2019-02-27 11:16:56 +11:00 committed by Peter Barker
parent 6103d5ebac
commit 3f6dd706d1
1 changed files with 7 additions and 10 deletions

View File

@ -343,16 +343,13 @@ MAV_RESULT GCS_MAVLINK_Tracker::handle_command_long_packet(const mavlink_command
switch(packet.command) { switch(packet.command) {
case MAV_CMD_COMPONENT_ARM_DISARM: case MAV_CMD_COMPONENT_ARM_DISARM:
if (packet.target_component == MAV_COMP_ID_SYSTEM_CONTROL) {
if (is_equal(packet.param1,1.0f)) { if (is_equal(packet.param1,1.0f)) {
tracker.arm_servos(); tracker.arm_servos();
return MAV_RESULT_ACCEPTED; return MAV_RESULT_ACCEPTED;
} else if (is_zero(packet.param1)) { }
if (is_zero(packet.param1)) {
tracker.disarm_servos(); tracker.disarm_servos();
return MAV_RESULT_ACCEPTED; return MAV_RESULT_ACCEPTED;
} else {
return MAV_RESULT_UNSUPPORTED;
}
} }
return MAV_RESULT_UNSUPPORTED; return MAV_RESULT_UNSUPPORTED;