From 25e071e21d9d87b82bae9e220b52e6eb73506ddb Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 31 Oct 2024 10:10:40 +1300 Subject: [PATCH] mavlink: no acks for commands that aren't for us We should not send out acks for commands that are not targetted at us. This can confuse other MAVLink components and MAVLink commands just don't scale that way, and it unnecessarily fills up our ack queue. This was likely introduced to debug when MAVLink components were implemented incorrectly sending commands to a wrong target. The most we should do in this case is to print/log an info. --- src/modules/mavlink/mavlink_receiver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index b573e36fec..0ddafa5f2a 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -566,10 +566,10 @@ void MavlinkReceiver::handle_message_command_both(mavlink_message_t *msg, const uint8_t progress = 0; // TODO: should be 255, 0 for backwards compatibility if (!target_ok) { - // Reject alien commands only if there is no forwarding or we've never seen target component before if (!_mavlink.get_forwarding_on() || !_mavlink.component_was_seen(cmd_mavlink.target_system, cmd_mavlink.target_component, _mavlink)) { - acknowledge(msg->sysid, msg->compid, cmd_mavlink.command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_FAILED); + PX4_INFO("Ignore command %d from %d/%d to %d/%d", + cmd_mavlink.command, msg->sysid, msg->compid, cmd_mavlink.target_system, cmd_mavlink.target_component); } return;