Skip to content

Commit

Permalink
action: use magic number to kill
Browse files Browse the repository at this point in the history
After mavlink/mavlink#1162
we need to add a magic number to the disarm command in order to disarm
the vehicle even if in-air.
  • Loading branch information
julianoes authored and JonasVautherin committed Jul 25, 2019
1 parent f4065b3 commit b222225
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/action/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Action::Result ActionImpl::kill() const

command.command = MAV_CMD_COMPONENT_ARM_DISARM;
command.params.param1 = 0.0f; // kill
command.params.param2 = 21196.f; // magic number to enforce in-air
command.target_component_id = _parent->get_autopilot_id();

return action_result_from_command_result(_parent->send_command(command));
Expand Down Expand Up @@ -315,6 +316,7 @@ void ActionImpl::kill_async(const Action::result_callback_t& callback)

command.command = MAV_CMD_COMPONENT_ARM_DISARM;
command.params.param1 = 0.0f; // kill
command.params.param2 = 21196.f; // magic number to enforce in-air
command.target_component_id = _parent->get_autopilot_id();

_parent->send_command_async(
Expand Down

0 comments on commit b222225

Please sign in to comment.