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 ros_gz_bridge from xml #550

Merged
merged 67 commits into from
May 23, 2024
Merged

Launch ros_gz_bridge from xml #550

merged 67 commits into from
May 23, 2024

Conversation

caguero
Copy link
Contributor

@caguero caguero commented May 20, 2024

🎉 New feature

Part of #552

Summary

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

How to test it?

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

ros2 launch ros_gz_bridge ros_gz_bridge.launch 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 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.

azeey and others added 30 commits February 21, 2024 15:22
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
* Launch file for the bridge

Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
* Launch file for the bridge

Signed-off-by: Carlos Agüero <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
* Launch file for the bridge

Signed-off-by: Carlos Agüero <[email protected]>
Base automatically changed from launch_gz to gz_sim_ros_node_composition May 21, 2024 15:10
@caguero caguero marked this pull request as ready for review May 22, 2024 19:41
@caguero caguero requested a review from ahcorde as a code owner May 22, 2024 19:41
Comment on lines 36 to 41
config_file: SomeSubstitutionsType,
container_name: SomeSubstitutionsType,
namespace: SomeSubstitutionsType,
use_composition: SomeSubstitutionsType,
use_respawn: SomeSubstitutionsType,
log_level: SomeSubstitutionsType,
Copy link
Contributor

Choose a reason for hiding this comment

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

All of these parameters are optional in ros_gz_bridge.launch.py right? Can we do the same here?

Here's an example: https://github.com/ros2/launch_ros/blob/2bf4e6057dea57669c19395f6f39d390bd420ee7/launch_ros/launch_ros/actions/node.py#L121-L129

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 0bfc81d.

Comment on lines 10 to 23
<gzserver
world_sdf_file="$(var world_sdf_file)"
world_sdf_string="$(var world_sdf_string)"
container_name="$(var container_name)"
use_composition="$(var use_composition)">
</gzserver>
<ros_gz_bridge
config_file="$(var config_file)"
container_name="$(var container_name)"
namespace="$(var namespace)"
use_composition="$(var use_composition)"
use_respawn="$(var use_respawn)"
log_level="$(var log_level)">
</ros_gz_bridge>
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks very nice!! 🎉

caguero and others added 7 commits May 23, 2024 19:04
Co-authored-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Signed-off-by: Carlos Agüero <[email protected]>
Base automatically changed from gz_sim_ros_node_composition to ros2 May 23, 2024 21:40
Signed-off-by: Carlos Agüero <[email protected]>
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!

@caguero caguero merged commit 10c1bd2 into ros2 May 23, 2024
3 checks passed
@caguero caguero deleted the launch_gz_bridge branch May 23, 2024 22:09
Amronos pushed a commit to Amronos/ros_gz that referenced this pull request Sep 18, 2024
* Add gzserver with ability to load an SDF file or string

Signed-off-by: Addisu Z. Taddese <[email protected]>
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