mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-30 13:00:57 +08:00
fix(mavlink): ignore DISTANCE_SENSOR on a distance sensor link (#29454)
A rangefinder peripheral such as the ARK DIST sends its ranges on a link in distance_sensor mode. The flight controller streams every range it has back on that link, the peripheral's own included, and the peripheral published each one as a second distance_sensor instance, which its DISTANCE_SENSOR stream then sent back out. On the flight controller the peripheral's own range came back a round trip late, and any other rangefinder's range came back labelled as the peripheral. A distance sensor link exists only to send ranges, so ignore the ones it receives.
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 4464ae66b5)
This commit is contained in:
1 parent
d00c2af091
commit
c55679977e
1 file changed
+6
-1
@@ -214,7 +214,12 @@ MavlinkReceiver::handle_message(mavlink_message_t *msg)
|
||||
break;
|
||||
|
||||
case MAVLINK_MSG_ID_DISTANCE_SENSOR:
|
||||
handle_message_distance_sensor(msg);
|
||||
|
||||
// The peer streams its ranges back on this link, ours among them, and the stream would send them out again
|
||||
if (_mavlink.get_mode() != Mavlink::MAVLINK_MODE::MAVLINK_MODE_DISTANCE_SENSOR) {
|
||||
handle_message_distance_sensor(msg);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MAVLINK_MSG_ID_FOLLOW_TARGET:
|
||||
|
||||
Reference in new issue
Block a user