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

ros_gz_bridge's expand_gz_topic_names:=true option does not expand namespace via CLI #702

Open
gyuray-dev opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@gyuray-dev
Copy link

Environment

  • OS Version: Docker osrf/ros:humble-simulation image on Windows host
  • Source or binary build? Binary

Description

  • Expected behavior:

According to example 6 in README, when I run the parameter bridge node with the following command:

ros2 run ros_gz_bridge parameter_bridge chatter@std_msgs/msg/String@ignition.msgs.StringMsg \
  --ros-args -p expand_gz_topic_names:=true -r __ns:=/demo

I should get the following result in other terminal:

$ ign topic -l
/demo/chatter

  • Actual behavior:

However, what I actually get is,

$ ign topic -l
/chatter

showing that the ros2 namespace /demo is not being expanded in Gazebo.

Steps to reproduce

  1. Run the Docker container:
docker run -it osrf/ros:humble-simulation bash
  1. Run parameter_bridge:
ros2 run ros_gz_bridge parameter_bridge chatter@std_msgs/msg/String@ignition.msgs.StringMsg \
--ros-args -p expand_gz_topic_names:=true -r __ns:=/demo &
  1. Check the published Gazebo topic
ign topic -l
  1. Check the package version
ros2 pkg xml ros_gz_bridge | grep version

Output

$ docker run -it osrf/ros:humble-simulation bash
root@5a1e78517ad9:/# ros2 run ros_gz_bridge parameter_bridge chatter@std_msgs/msg/String@ignition.msgs.StringMsg \
> --ros-args -p expand_gz_topic_names:=true -r __ns:=/demo &
[1] 46
[INFO] [1741312065.048477935] [demo.ros_gz_bridge]: Creating GZ->ROS Bridge: [chatter (ignition.msgs.StringMsg) -> chatter (std_msgs/msg/String)] (Lazy 0)
[INFO] [1741312065.049322357] [demo.ros_gz_bridge]: Creating ROS->GZ Bridge: [chatter (std_msgs/msg/String) -> chatter (ignition.msgs.StringMsg)] (Lazy 0)

root@5a1e78517ad9:/# ign topic -l
/chatter
root@5a1e78517ad9:/# ros2 pkg xml ros_gz_bridge | grep version
  <version>0.244.15</version>
root@5a1e78517ad9:/#

You can confirm that the package version is later than the update release 0.244.14-1.

Additional Information

Namespace expansion works correctly using config file as described in PR #512.

bridge_test.yaml

- topic_name: "chatter"
  ros_type_name: "std_msgs/msg/String"
  gz_type_name: "gz.msgs.StringMsg"
  direction: BIDIRECTIONAL
$ ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=bridge_test.yaml -p expand_gz_topic_names:=true -r __ns:=/demo
[INFO] [1741313538.106040771] [demo.ros_gz_bridge]: Creating GZ->ROS Bridge: [/demo/chatter (gz.msgs.StringMsg) -> chatter (std_msgs/msg/String)] (Lazy 0)
[INFO] [1741313538.115632282] [demo.ros_gz_bridge]: Creating ROS->GZ Bridge: [chatter (std_msgs/msg/String) -> /demo/chatter (gz.msgs.StringMsg)] (Lazy 0)
$ ign topic -l
/demo/chatter
@gyuray-dev gyuray-dev added the bug Something isn't working label Mar 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant