Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

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

Closed
peci1 wants to merge 1 commit intoros:noetic-develfrom
peci1:fix-private-remap
Closed

roscpp: Fixed remapping of private parameters in anonymous nodes#2325
peci1 wants to merge 1 commit intoros:noetic-develfrom
peci1:fix-private-remap

Conversation

@peci1
Copy link
Copy Markdown
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.

@sloretz
Copy link
Copy Markdown
Contributor

sloretz commented Apr 25, 2025

Thank you for the PR!

ROS Noetic will reach end-of-life on May 31st, 2025. Every change comes with a risk of introducing regressions, and there isn't much time left to fix them. To make sure this PR doesn't introduce any regressions please:

  • Describe how you tested this change
  • Recruit at least one more person to review this PR and try it out on their system

@peci1
Copy link
Copy Markdown
Contributor Author

peci1 commented May 4, 2025

This PR comes with a rostest that tests the described behavior.

@sloretz
Copy link
Copy Markdown
Contributor

sloretz commented May 31, 2025

ROS 1 is end-of-life (EOL) as of today, May 31st 2025. I am archiving this repository because:

  • it only supports ROS 1
  • it isn't needed anymore in ROS 2

If you still rely on ROS 1, read this page to learn about your options.

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

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

2 participants