Fix CLI namespace expansion for expand_gz_topic_names - #873
Open
AyushSuri8 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Ayush <vtdlduddn3267@gmail.com>
ahcorde
requested changes
Mar 30, 2026
ahcorde
left a comment
Collaborator
There was a problem hiding this comment.
Do you mind to target rolling ? and add some tests?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Fixes #702.
The Issue:
When creating a bridge via CLI string parsing (e.g.,
topic@ros_type@gz_type), theexpand_gz_topic_namesparameter was being completely ignored, whereas it worked correctly when passed via a YAML config file.The Fix:
Updated the argument parsing loop in
parameter_bridge.cppto:expand_gz_topic_namesparameter and the node's current namespace viaget_namespace().config.gz_topic_namewhen the parameter is set to true, preventing double slashes.Testing:
Reproduced the original issue using the
osrf/ros:humble-simulationDocker container. Built this branch from source and verified that running: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:=/demoNow correctly results in
ign topic -loutputting:/demo/chatter