Ask Your Question
0

Node Name Collision with multiple talker node instances

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

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 (http://143.192.2.2:36426) will be shutdown.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

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

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:

nodeConfiguration.setNodeName("node")

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

edit flag offensive delete link more

Comments

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 imageDan Lazewatsky ( 2012-05-07 06:44:30 -0500 )edit

that was perfect. thanks.

Srogacki gravatar imageSrogacki ( 2012-05-08 10:49:32 -0500 )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 imagejatowler ( 2012-05-15 08:51:44 -0500 )edit

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

Martin Günther gravatar imageMartin Günther ( 2012-05-15 22:58:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 960 times

Last updated: May 06 '12