mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:58:54 +08:00
[uxrce_dds_client] Allow for arbitrary topic instances to be bridged (#22350)
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com> Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
This commit is contained in:
co-authored by
Jacob Dahl
parent
8a2239f3e8
commit
ffc184fcf7
@@ -503,6 +503,11 @@ publications:
|
||||
- topic: /fmu/out/vehicle_trajectory_waypoint_desired
|
||||
type: px4_msgs::msg::VehicleTrajectoryWaypoint
|
||||
|
||||
- topic: /fmu/out/vehicle_imu
|
||||
type: px4_msgs::msg::VehicleImu
|
||||
rate_limit: 50.
|
||||
instance: 1 # OPTIONAL
|
||||
|
||||
subscriptions:
|
||||
|
||||
- topic: /fmu/in/offboard_control_mode
|
||||
@@ -535,6 +540,9 @@ Each (`topic`,`type`) pairs defines:
|
||||
4. The message type (`VehicleOdometry`, `VehicleStatus`, `OffboardControlMode`, etc.) and the ROS 2 package (`px4_msgs`) that is expected to provide the message definition.
|
||||
5. **(Optional)**: An additional `rate_limit` field (only for publication entries), which specifies the maximum rate (Hz) at which messages will be published on this topic by PX4 to ROS 2.
|
||||
If left unspecified, the maximum publication rate limit is set to 100 Hz.
|
||||
6. **(Optional)**: An additional `instance` field (only for publication entries), which lets you select which instance of a [multi-instance topic](./uorb.md#multi-instance) you want to be published to ROS 2.
|
||||
If provided, this option changes the ROS 2 topic name of the advertised uORB topic appending the instance number: `fmu/out/[uorb topic name][instance]` (plus eventual namespace and message version).
|
||||
In the example above the final topic name would be `/fmu/out/vehicle_imu1`.
|
||||
|
||||
`subscriptions` and `subscriptions_multi` allow us to choose the uORB topic instance that ROS 2 topics are routed to: either a shared instance that may also be getting updates from internal PX4 uORB publishers, or a separate instance that is reserved for ROS2 publications, respectively.
|
||||
Without this mechanism all ROS 2 messages would be routed to the _same_ uORB topic instance (because ROS 2 does not have the concept of [multiple topic instances](../middleware/uorb.md#multi-instance)), and it would not be possible for PX4 subscribers to differentiate between streams from ROS 2 or PX4 publishers.
|
||||
|
||||
Reference in New Issue
Block a user