gazebosim / ros_gz

Integration between ROS (1 and 2) and Gazebo simulation
https://gazebosim.org
Apache License 2.0
211 stars 125 forks source link

Launch file for running gz_bridge #530

Closed caguero closed 2 months ago

caguero commented 2 months ago

🎉 New feature

Part of https://github.com/gazebosim/ros_gz/issues/544

Summary

This patch allows to run the ros_gz bridge as an executable or as a composable node.

How to test it?

Use the provided ros_gz_bridge.launch.py (modify config_file accordingly) to run the bridge as an executable

ros2 launch ros_gz_bridge ros_gz_bridge.launch.py config_file:=/home/caguero/ros_gz_ws/src/ros_gz/ros_gz_bridge/test/config/full.yaml

Verify that you see the /ros_chatter topic:

caguero@cold:~/ros_gz_ws$ ros2 topic list
/parameter_events
/ros_chatter
/rosout

And confirm that no container has been created:

caguero@cold:~/ros_gz_ws$ ros2 component list

Now CTRL-C the bridge and try the composable version:

 ros2 launch ros_gz_bridge ros_gz_bridge.launch.py config_file:=/home/caguero/ros_gz_ws/src/ros_gz/ros_gz_bridge/test/config/full.yaml use_composition:=True

Verify that you see the /ros_chatter topic:

caguero@cold:~/ros_gz_ws$ ros2 topic list
/parameter_events
/ros_chatter
/rosout

And confirm that a container has been created:

caguero@cold:~/ros_gz_ws$ ros2 component list
/ros_gz_container
  1  /ros_gz_bridge

Test it

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.