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

Global __node argument causes node name collisions #843

Open
rotu opened this issue Sep 3, 2019 · 1 comment
Open

Global __node argument causes node name collisions #843

rotu opened this issue Sep 3, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@rotu
Copy link
Contributor

rotu commented Sep 3, 2019

When spawning a process that has multiple internal nodes, the __node:=some_node_name argument applies to all nodes in that process. Take, for instance, the TransformListener, which spawns a node to hold its subscription. If multiple TransformListeners are used, those nodes might have different names by default, but passing the command line __node option causes these to get started with the same name.

This makes things like setting arguments, calling services, and sometimes just setting up publishers/subscribers fail in various ways and has been pervasive in the Navigation2 stack: ros-navigation/navigation2#842

A couple possible resolutions:

  1. Handle duplicate node names in the same process more gracefully.
  2. Only respect the global __node option for the first node created in a process.
  3. Make __node only select the prefix to the node name. If multiple nodes are attempted to be created with the same name, append a (sequential?) suffix to uniquify them.
  4. Add a parameter to the Node constructor to ignore the global node name override but respect the other global options. (this doesn't fully solve the problem of unique names, since the node is now responsible for making sure they're globally unique and any API that creates nodes must now enforce it).
  5. Deprecate the global __node option and respect the node name passed to the Node constructor (Then launch_ros.actions.Node will have to use more targeted remapping to ensure that subnodes are

Discussion of a hacky workaround (pass __node argument to internal nodes to override the top-level __node argument) can be found here ros2/geometry2#159

@rotu
Copy link
Contributor Author

rotu commented Sep 3, 2019

FYI @hidmic, @ivanpauno

@mabelzhang mabelzhang added the bug Something isn't working label Sep 12, 2019
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
…esolution (ros2#843)

* Change type of PlayOptions::delay to rclcpp::Duration

Signed-off-by: Emerson Knapp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants