Skip to content

Commit a574980

Browse files
Amronosahcorde
andauthored
Add documentation on QOS Overrides and the bridge_params argument (#539)
Signed-off-by: Aarav Gupta <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 8c04d6d commit a574980

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

harmonic/ros2_integration.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -78,36 +78,34 @@ ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge con
7878
Alternatively, if an existing container is already running, you can pass its name
7979
when launching the bridge using the `container_name` parameter. More info about composition can be viewed [here](ros2_overview.md#composition)
8080

81-
Check [this block](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_bridge/launch/ros_gz_bridge.launch.py#L27-L34)
81+
Check [this block](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_bridge/launch/ros_gz_bridge.launch.py#L25-L68)
8282
from the source code to know all the different parameters accepted by this
8383
launch file.
8484

85+
QOS Overrides:
86+
87+
QOS overrides can be passed as extra parameters to the bridge using the `bridge_params` argument of the launch file. An example of this:
88+
```bash
89+
ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge config_file:=<path_to_your_YAML_file> bridge_params:={'qos_overrides./topic_name.publisher.durability': 'transient_local', 'qos_overrides./another_topic_name.publisher.durability': 'transient_local'}
90+
```
91+
You can omit the following from what you pass to `bridge_params`: `{}`, ` `, `"`, `'`.
92+
93+
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)
94+
8595
## Launching the bridge from a custom launch file in XML.
8696

8797
It's also possible to trigger the bridge from your custom launch file. For that
8898
purpose we have created the `<ros_gz_bridge/>` tag that can be used from you
8999
XML or YAML launch file. In this case, the arguments are passed as attributes
90-
within this tag. Here's an example:
100+
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):
91101

92102
```xml
93103
<launch>
94104
<arg name="bridge_name" />
95105
<arg name="config_file" />
96-
<arg name="container_name" default="ros_gz_container" />
97-
<arg name="create_own_container" default="False" />
98-
<arg name="namespace" default="" />
99-
<arg name="use_composition" default="False" />
100-
<arg name="use_respawn" default="False" />
101-
<arg name="log_level" default="info" />
102106
<ros_gz_bridge
103107
bridge_name="$(var bridge_name)"
104-
config_file="$(var config_file)"
105-
container_name="$(var container_name)"
106-
create_own_container="$(var create_own_container)"
107-
namespace="$(var namespace)"
108-
use_composition="$(var use_composition)"
109-
use_respawn="$(var use_respawn)"
110-
log_level="$(var log_level)">
108+
config_file="$(var config_file)">
111109
</ros_gz_bridge>
112110
</launch>
113111
```
@@ -119,7 +117,7 @@ of the values or not even use all the parameters.
119117
## Launching the bridge from a custom launch file in Python.
120118

121119
Here's a simplified example of a Python launch file used to load a bridge from
122-
Python:
120+
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):
123121
```python
124122
from launch import LaunchDescription
125123
from launch.actions import DeclareLaunchArgument

0 commit comments

Comments
 (0)