Skip to content
New issue

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

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

Already on GitHub? # to your account

Launch file for running gz_bridge #530

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Apr 10, 2024

🎉 New feature

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

  • 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 2 commits April 10, 2024 19:30
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@@ -0,0 +1,110 @@

Copy link
Collaborator

Choose a reason for hiding this comment

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

remove first empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in ff3149b

declare_container_name_cmd = DeclareLaunchArgument(
'container_name',
default_value='ros_gz_container',
description='the name of container that nodes will load in if use composition',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description='the name of container that nodes will load in if use composition',
description='Name of container that nodes will load in if use composition',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in ff3149b

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM


declare_container_name_cmd = DeclareLaunchArgument(
'container_name',
default_value='ros_gz_container',
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: The default here should match what we name container in #528

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated ff3149b.

Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero marked this pull request as ready for review April 11, 2024 17:39
@caguero caguero merged commit 1124d28 into gz_sim_ros_node_composition Apr 11, 2024
5 checks passed
@caguero caguero deleted the ros_gz_bridge_launch branch April 11, 2024 17:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants