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 combined gzserver + bridge #533

Closed caguero closed 1 month ago

caguero commented 2 months ago

🎉 New feature

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

Summary

This patch lets you combine the functionality from #530 and #532 into a single launch file.

How to test it?

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

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

You should see messages of gzserver loading. Additionally, verify that you see the /ros_chatter topic:

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

Confirm that no container has been created:

caguero@cold:~/ros_gz_ws$ ros2 component list

Now CTRL-C to stop all nodes and try the composable version:

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

gzserver should be running. Verify that you also 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 with both nodes:

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

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.

caguero commented 1 month ago

@ahcorde, is CI supposed to pass right now with 24.04?

ahcorde commented 1 month ago

@caguero yes, I think it should pass