From 15d3d57e5efb06a4b073c7006e4a16d8546007e5 Mon Sep 17 00:00:00 2001 From: Aarav Gupta Date: Sun, 17 Nov 2024 08:55:32 +0530 Subject: [PATCH] Add documentation on QOS Overrides and the bridge_params argument Signed-off-by: Aarav Gupta --- harmonic/ros2_integration.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/harmonic/ros2_integration.md b/harmonic/ros2_integration.md index d504d81011..b23339f2f7 100644 --- a/harmonic/ros2_integration.md +++ b/harmonic/ros2_integration.md @@ -78,36 +78,34 @@ ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge con Alternatively, if an existing container is already running, you can pass its name when launching the bridge using the `container_name` parameter. More info about composition can be viewed [here](ros2_overview#composition) -Check [this block](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_bridge/launch/ros_gz_bridge.launch.py#L27-L34) +Check [this block](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_bridge/launch/ros_gz_bridge.launch.py#L25-L68) from the source code to know all the different parameters accepted by this launch file. +QOS Overrides: + +QOS overrides can be passed as extra parameters to the bridge using the `bridge_params` argument of the launch file. An example of this: +```bash +ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge config_file:= bridge_params:={'qos_overrides./topic_name.publisher.durability': 'transient_local', 'qos_overrides./another_topic_name.publisher.durability': 'transient_local'} +``` +You can omit the following from what you pass to `bridge_params`: `{}`, ` `, `"`, `'`. + +More info about using QOS overrides can be found [here](https://docs.ros.org/en/jazzy/How-To-Guides/Overriding-QoS-Policies-For-Recording-And-Playback.html#using-qos-overrides) + ## Launching the bridge from a custom launch file in XML. It's also possible to trigger the bridge from your custom launch file. For that purpose we have created the `` tag that can be used from you XML or YAML launch file. In this case, the arguments are passed as attributes -within this tag. Here's an example: +within this tag. Here's a simplified example, a more comprehensive example can be viewed [here](https://github.com/gazebosim/ros_gz/blob/ros2/ros_gz_bridge/launch/ros_gz_bridge.launch): ```xml - - - - - - + config_file="$(var config_file)"> ``` @@ -119,7 +117,7 @@ of the values or not even use all the parameters. ## Launching the bridge from a custom launch file in Python. Here's a simplified example of a Python launch file used to load a bridge from -Python: +Python, a more comprehensive example can be viewed [here](https://github.com/gazebosim/ros_gz/blob/ros2/ros_gz_bridge/launch/ros_gz_bridge.launch.py): ```python from launch import LaunchDescription from launch.actions import DeclareLaunchArgument