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

Node Name Collision with multiple talker node instances

asked 2012-05-06 03:41:02 -0600

Srogacki gravatar image

I have modified the android_tutorial_pubsub app to send and receive text at the same time. I am trying to run a listener instance, two talker instances, and two RosTextView instances. I have seen some info on private naming, but nothing has been very clear. How do I ensure that two instances of the same kind of node don't collide?

The warning follows: 07-21 07:14:56.276: W/System.err(15939): Node name collision. Existing node /rosjava_tutorial_pubsub/talker ( will be shutdown.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2012-05-06 23:27:19 -0600

The warning means that another node with the same name has been started. In ROS, node names need to be unique, and the convention is that when a new node with the same name is started, the old one should exit.

Presumably, you create a NodeConfiguration somewhere in order to start your talker node. There, you can change the node name using the following method:


You should make sure you set a different name for both talker instances.

edit flag offensive delete link more


Also, rospy and roscpp both have ways of initializing a node as anonymous, which allows you to start multiple instances of the same node and automatically assign them different names. I couldn't find a way to do this in rosjava, though the docs seem a bit broken at the moment.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2012-05-07 06:44:30 -0600 )edit

that was perfect. thanks.

Srogacki gravatar image Srogacki  ( 2012-05-08 10:49:32 -0600 )edit

Another option: if you never set a node name in your NodeConfiguration, the node name will be set to the default from your NodeMain's getDefaultNodeName() method instead. Of course, this is only useful if you only start one instance of each node class, but it lets you re-use the NodeConfiguration.

jatowler gravatar image jatowler  ( 2012-05-15 08:51:44 -0600 )edit

... which is why it isn't useful in this particular situation. :-)

Martin Günther gravatar image Martin Günther  ( 2012-05-15 22:58:58 -0600 )edit

Question Tools


Asked: 2012-05-06 03:41:02 -0600

Seen: 1,137 times

Last updated: May 06 '12