mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
feat(uxrce_dds_client): accept RTCM corrections from ROS 2 (#29368)
* feat(uxrce_dds_client): accept RTCM corrections from ROS 2 ROS 2 setups that need RTK had to keep a MAVLink link beside DDS just for GPS_RTCM_DATA. Routing by device_id gives each DDS source its own rtcm_corrections instance, so two publishers never interleave their byte streams. The DDS side needs no framing: the injectors reframe the stream from arbitrary chunks. Assisted-by: Claude:claude-opus-5-5 * docs(releases): note RTCM corrections over uXRCE-DDS Assisted-by: Claude:claude-opus-5-5 * fix(uavcan): bound RTCM corrections length before forwarding uXRCE-DDS is the first rtcm_corrections source that does not bound len. A ROS 2 RtcmData with len over 300 made the DroneCAN forwarder read past the data array and broadcast that memory as RTCMStream. Assisted-by: Claude:claude-opus-5-5 * docs(msg): drop the uXRCE-DDS routing note from RtcmData It described the client's routing rather than the message, and the device_id field comment already covers it. Assisted-by: Claude:claude-opus-5-5 * fix(uavcan): bound moving-baseline length before forwarding The forwarder trusted the publisher's len, the same gap just closed for rtcm_corrections. No current publisher exceeds the array, so this only keeps a future one from reading past it. Assisted-by: Claude:claude-opus-5-5 --------- Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
This commit is contained in:
1 parent
5b518d2d95
commit
be03ec79c9
5 files changed
+18
-3
No files matched your search
@@ -65,6 +65,14 @@ Current limitations:
|
||||
- Stale partial state is dropped after 1 second if the rest of the fragments do not arrive.
|
||||
- The legacy exact-multiple compatibility fallback only works if another `sequence_id` arrives before that 1 second timeout. Otherwise the buffered partial message is dropped.
|
||||
|
||||
### Corrections from ROS 2
|
||||
|
||||
ROS 2 applications can send corrections over [uXRCE-DDS](../middleware/uxrce_dds.md) by publishing [`px4_msgs/msg/RtcmData`](../msg_docs/RtcmData.md) on `/fmu/in/rtcm_corrections`:
|
||||
|
||||
- Split the correction byte stream into consecutive messages of up to 300 bytes (`data`, `len`). Message boundaries need not match RTCM frame boundaries.
|
||||
- Give each source its own constant `device_id`. Each value is routed to its own `rtcm_corrections` instance, so two sources sharing an ID interleave their streams.
|
||||
- A `timestamp` of 0 is replaced with the time of receipt.
|
||||
|
||||
### RTCM messages
|
||||
|
||||
QGroundControl configures the RTK base station to output the following RTCM3.2 frames, each with 1 Hz, unless otherwise stated:
|
||||
|
||||
@@ -144,6 +144,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide).
|
||||
### uXRCE-DDS / Zenoh / ROS 2
|
||||
|
||||
- (uXRCE-DDS): SITL multi vehicle automatic namespace prefix is now `uav_{px4_instance}` and it is aligned with the behaviour of `UXRCE_DDS_NS_IDX`. ([PX4-Autopilot#28338](https://github.com/PX4/PX4-Autopilot/pull/28338))
|
||||
- (uXRCE-DDS): RTK corrections can be published from ROS 2 on `/fmu/in/rtcm_corrections` ([RtcmData](../msg_docs/RtcmData.md)); see [Corrections from ROS 2](../advanced/rtk_gps.md#corrections-from-ros-2). ([PX4-Autopilot#29368](https://github.com/PX4/PX4-Autopilot/pull/29368))
|
||||
|
||||
### MAVLink
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
# Published under two topic names that share this definition (see TOPICS below):
|
||||
#
|
||||
# rtcm_corrections - external fixed-base corrections fed into the vehicle (MAVLink
|
||||
# GPS_RTCM_DATA, UAVCAN RTCMStream, GPS drivers in dump mode). Multiple
|
||||
# GPS_RTCM_DATA, UAVCAN RTCMStream, uXRCE-DDS, GPS drivers in dump mode). Multiple
|
||||
# sources are allowed, one uORB instance each; consumers select one instance.
|
||||
#
|
||||
# rtcm_moving_baseline - moving-base GPS output (RTCM 4072 or equivalent) intended for a rover.
|
||||
|
||||
@@ -628,7 +628,8 @@ void UavcanGnssBridge::drainRtcmCorrections()
|
||||
|
||||
have_msg = false;
|
||||
num_injections++;
|
||||
PublishRTCMStream(msg.data, msg.len);
|
||||
// uXRCE-DDS passes the publisher's len through unchecked
|
||||
PublishRTCMStream(msg.data, math::min<size_t>(msg.len, sizeof(msg.data)));
|
||||
_rtcm_injection_rate_message_count++;
|
||||
_last_rtcm_injection_time = hrt_absolute_time();
|
||||
}
|
||||
@@ -655,7 +656,7 @@ void UavcanGnssBridge::drainMovingBaseline()
|
||||
last_generation, _rtcm_moving_baseline_sub.get_last_generation());
|
||||
}
|
||||
|
||||
PublishMovingBaselineData(msg.data, msg.len);
|
||||
PublishMovingBaselineData(msg.data, math::min<size_t>(msg.len, sizeof(msg.data)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -248,3 +248,8 @@ subscriptions_multi:
|
||||
type: px4_msgs::msg::AuxGlobalPosition
|
||||
route_field: id
|
||||
max_instances: 4
|
||||
|
||||
- topic: /fmu/in/rtcm_corrections
|
||||
type: px4_msgs::msg::RtcmData
|
||||
route_field: device_id
|
||||
max_instances: 4
|
||||
Reference in new issue
Block a user