rcl icon indicating copy to clipboard operation
rcl copied to clipboard

Anonymous Nodes

Open danthony06 opened this issue 2 years ago • 6 comments

Feature request

Feature description

Enable anonymous node names.

Implementation considerations

We frequently used anonymous nodes in ROS 1 when developing debugging and introspection tools. I see a lot of references to anonymous nodes throughout the core ROS2 libraries, and inside rcl/node_options.h, but it seems to have been disabled or abandoned. I also saw this comment mentioning that they're a desirable feature: https://github.com/ros2/rcl/issues/375#issuecomment-458648680. Is there any reason they have not been implemented in ROS 2?

I think ROS1 just used the wall timer to generate a unique ID. Will this approach work in ROS 2?

danthony06 avatar Feb 22 '23 15:02 danthony06

This node option was considered long time ago, but never implemented yet.

https://github.com/ros2/rcl/blob/2d34ba831fc4693e2e44af2da40281f393ed88c8/rcl/include/rcl/node_options.h#L36

I think that this node option is useful for user application.

fujitatomoya avatar Feb 24 '23 21:02 fujitatomoya

I've started working on adding this, and have a partial implementation.

danthony06 avatar Feb 24 '23 21:02 danthony06

I've started working on adding this, and have a partial implementation.

danthony06 avatar Feb 24 '23 21:02 danthony06

This would be great to have!

Note that any implementation of this should append the anonymisation suffix after any node name and node namespace remaps are done (as well as after parameters are loaded.) Because otherwise users wouldn't be able to set parameters, and the node_name:__node:=new_node_name remap signature wouldn't work.

Another useful bonus would be if a CLI argument could be used to configure this behavior too.


PS: I had some internal discussions with the ROS folks and it seems like node anonymisation is a desired feature but just not implemented yet. So please do go ahead with an implementation!

methylDragon avatar Mar 02 '23 21:03 methylDragon

Thanks, I was planning on appending a random number to a given node name, if the user supplies it. In ROS 1 we used the wall time as the anonymous node name. Does this still sound like a good approach?

On Thu, Mar 2, 2023, 3:42 PM methylDragon @.***> wrote:

This would be great to have!

Note that any implementation of this should append the anonymisation suffix after any node name and node namespace remaps are done (as well as after parameters are loaded.)

Another useful bonus would be if a CLI argument could be used to configure this behavior too.

— Reply to this email directly, view it on GitHub https://github.com/ros2/rcl/issues/1034#issuecomment-1452588001, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBZWHFHZGMYCW5MSSIL7OLW2EH5XANCNFSM6AAAAAAVEP54JU . You are receiving this because you authored the thread.Message ID: @.***>

danthony06 avatar Mar 02 '23 22:03 danthony06

I think following ROS 1 would be okay, and it has the added benefit of giving that little bit more information that helps to order nodes (alphanumerically, I mean)

methylDragon avatar Mar 02 '23 22:03 methylDragon