-
Notifications
You must be signed in to change notification settings - Fork 500
Description
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:
- Handle duplicate node names in the same process more gracefully.
- Only respect the global
__nodeoption for the first node created in a process. - Make
__nodeonly 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. - 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).
- Deprecate the global
__nodeoption and respect the node name passed to the Node constructor (Thenlaunch_ros.actions.Nodewill 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