ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How do I start a node with an anonymous name with roslaunch?

asked 2011-07-14 21:54:26 -0500

Benoit Larochelle gravatar image

updated 2011-07-16 13:02:34 -0500

kwc gravatar image

I have a node that passes the following argument when calling ros::init:


It works fine and gives me a unique node name. However, when I launch this node from a roslaunch file, it does not create a unique node name anymore.

How do I fix this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-15 04:25:13 -0500

kwc gravatar image

Please see:

" $(anon name)

e.g. $(anon rviz-1). Generates an anonymous id based on name. name itself is a unique identifier: multiple uses of $(anon foo) will create the same "anonymized" name. This is used for <node> name attributes in order to create nodes with anonymous names, as ROS requires nodes to have unique names. "

edit flag offensive delete link more


Is there a way to actually generate random ids/names then?

F1iX gravatar image F1iX  ( 2020-10-01 05:23:20 -0500 )edit

answered 2011-07-14 21:59:56 -0500

dornhege gravatar image

The "name" tag in roslaunch will override this name. The fix would be to use unique names in the name tag.

edit flag offensive delete link more


This would work in some situations, but in my case I distribute the same launch file (via SVN) to many collegues, and of course I can't ask all of them to modify the launch file manually at every update that I make.
Benoit Larochelle gravatar image Benoit Larochelle  ( 2011-07-14 23:34:36 -0500 )edit
I think I don't quite understand the problem here. Why should one want to run the same node in parallel several times on one core? Either you have the same node with different parameters, i.e. different launch files or one instance is enough. Maybe you can make your application a little bit clearer?
Lorenz gravatar image Lorenz  ( 2011-07-15 01:28:45 -0500 )edit
Why would anyone need to modify the launch file, if it contains different names for the same (multiple) nodes?
dornhege gravatar image dornhege  ( 2011-07-15 02:31:59 -0500 )edit
You might want to launch the same launch file several times. Such as a system with many homogeneous robots.
tfoote gravatar image tfoote  ( 2011-07-19 04:58:07 -0500 )edit

Question Tools

1 follower


Asked: 2011-07-14 21:54:26 -0500

Seen: 5,708 times

Last updated: Jul 15 '11