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

roscpp: Fixed remapping of private parameters in anonymous nodes #2325

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

peci1
Copy link
Contributor

@peci1 peci1 commented Apr 9, 2023

Fixes #2324.

This fix runs all private name remaps through another round of remapping after the anonymous node name is finished. The first remapping round is done with incomplete node name, which resulted in inability to remap private names for anonymous nodes without __name:= arg.

The new behavior corresponds to what rospy is doing.

The impact on existing code should be close to zero. Anything launched from a launch file will not be affected. The only affected usages are manual rosrun commands (and if somebody does some crazy things around ros::init()).

I did not find a good way to remove the wrong remappings, so they remain there. I.e. g_remappings will contain both /node/topic->newtopic and /node_12321321/topic->newtopic. This isn't correct, but it could actually serve as a backwards compatibility feature for the case if someone was working around #2324 by explicitly remapping the incomplete name.

Real-world tools affected by #2324 can be found e.g. here: http://docs.ros.org/en/latest/api/cras_topic_tools/html/classcras_1_1ThrottleMessagesNodelet.html#details . It is an improved version of topic_tools throttle which, if no topic args are given through CLI, subscribes to ~input topic. When running as rosrun cras_topic_tools throttle ~input:=/remapped, the remap does not happen without this PR. Appending __name:=foo makes the remap happy, which is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remapping private topics of anonymous nodes works differently in rospy and roscpp
1 participant