Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch file for combined gzserver + bridge #533

Merged
merged 13 commits into from
May 15, 2024

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Apr 12, 2024

🎉 New feature

Part of #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

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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 added 7 commits April 10, 2024 19:30
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero requested a review from ahcorde as a code owner April 12, 2024 17:11
@caguero caguero changed the base branch from ros2 to gzserver_launch April 12, 2024 17:11
ros_gz_sim/launch/ros_gz_sim.launch.py Outdated Show resolved Hide resolved
namespace = LaunchConfiguration('namespace')
use_composition = LaunchConfiguration('use_composition')
use_respawn = LaunchConfiguration('use_respawn')
log_level = LaunchConfiguration('log_level')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine we'll have a log_level parameter for gz_sever as well at some point. How would we distinguish parameters for the server and parameters for the bridge? Should we rename this to bridge_log_level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed in 66e74f8



def generate_launch_description():

world_sdf_file_arg = DeclareLaunchArgument(
config_file = LaunchConfiguration('config_file')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any luck with refactoring these into a separate Python module so we don't have to duplicate code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any luck with refactoring these into a separate Python module so we don't have to duplicate code?

Apparently this is possible by creating a separate launch file for the common parts. I'll do it in a separate PR.

Base automatically changed from gzserver_launch to gz_sim_ros_node_composition April 18, 2024 20:03
caguero and others added 2 commits April 18, 2024 22:04
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Carlos Agüero <cen.aguero@gmail.com>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero
Copy link
Contributor Author

caguero commented May 13, 2024

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

@ahcorde
Copy link
Collaborator

ahcorde commented May 13, 2024

@caguero yes, I think it should pass

caguero added 3 commits May 15, 2024 16:31
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero merged commit c2a26ef into gz_sim_ros_node_composition May 15, 2024
3 checks passed
@caguero caguero deleted the gzserver_and_bridge_launch branch May 15, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants