Skip to content

Fix ros_gz_bridge parameter_bridge command syntax#6177

Open
Shivam-Bhardwaj wants to merge 1 commit into
ros2:humblefrom
Shivam-Bhardwaj:fix/issue-3761-gazebo-command
Open

Fix ros_gz_bridge parameter_bridge command syntax#6177
Shivam-Bhardwaj wants to merge 1 commit into
ros2:humblefrom
Shivam-Bhardwaj:fix/issue-3761-gazebo-command

Conversation

@Shivam-Bhardwaj

Copy link
Copy Markdown
Contributor

Summary

Fixes the ros_gz_bridge parameter_bridge command in the Gazebo tutorial.

The command was using [ instead of @ as the separator between ROS and Gazebo message types:

- ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan[ignition.msgs.LaserScan
+ ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan

The incorrect syntax causes a "bad pattern" error.

Fixes #3761

The command was using '[' instead of '@' as the separator between
ROS and Gazebo message types, causing a 'bad pattern' error.

@ahcorde ahcorde left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@gavanderhoorn

gavanderhoorn commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

@ahcorde: perhaps #3761 (comment) is a better explanation of when/why it doesn't work.

It's a localised issue: when using Zsh as a shell, the bridge configuration string is interpreted as a regex/special character.

Just changing it to @ is not a proper solution though.


Edit: perhaps quoting using single quotes would already fix the issue? I haven't tried.

@kscottz

kscottz commented Jan 29, 2026

Copy link
Copy Markdown
Collaborator

Per waffle, @azeey can you take a look at this?


$ source /opt/ros/{DISTRO}/setup.bash
$ ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan[ignition.msgs.LaserScan --ros-args -r /lidar2:=/laser_scan
$ ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan --ros-args -r /lidar2:=/laser_scan

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This change creates a bidirectional bridge, but that is not necessary. The original version should work as is and bridges data from Gazebo -> ROS. Looking at #3761 (comment), I think the best otion is to wrap the whole thing in single quotes

Suggested change
$ ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan --ros-args -r /lidar2:=/laser_scan
$ ros2 run ros_gz_bridge parameter_bridge `/lidar2@sensor_msgs/msg/LaserScan[ignition.msgs.LaserScan` --ros-args -r /lidar2:=/laser_scan

@kscottz kscottz added the more-information-needed Further information is required label Feb 5, 2026
@dlanov

dlanov commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This PR appears stale, and the reviewer feedback suggests preserving the original Gazebo -> ROS bridge syntax while quoting the bridge argument to avoid Zsh glob parsing. I can open a small replacement PR for that approach if that would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

more-information-needed Further information is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants