mavlink_command_sender: fix logic after first test

- change/add a few printfs so they make more sense
- don't accidentally ignore command_acks
- don't forward commands to the same component id, and don't forward
  commands that are broadcast to all components (target component 0)
This commit is contained in:
Julian Oes
2017-07-08 11:52:23 +02:00
committed by Lorenz Meier
parent af0107ae0a
commit e6d31f951c
3 changed files with 12 additions and 7 deletions
@@ -141,7 +141,7 @@ void MavlinkCommandSender::handle_mavlink_command_ack(const mavlink_command_ack_
if (item->command.command == ack.command &&
from_sysid == item->command.target_system &&
from_compid == item->command.target_component) {
PX4_INFO("handling result %d for command %d: %d", ack.result, ack.command);
PX4_INFO("dropping command %d", ack.command);
// Drop it anyway because the command seems to have arrived at the destination, even if we
// receive IN_PROGRESS because we trust that it will be handled after that.
_commands.drop_current();