0
$\begingroup$

Rosanswers logo

in the tf tutorial. in: writing a tf broadcaster (Python), while creating the launch file (in section, running the broadcaster), why it is written:

<node name="turtle1_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >

, because the node was created as:

rospy.init_node('turtle_tf_broadcaster')

not

rospy.init_node('turtle1_tf_broadcaster')

So how will ros identify the node??

Ans what does respawn="false" mean?


Originally posted by anwesha17k on ROS Answers with karma: 1 on 2018-01-05

Post score: 0


Original comments

Comment by jayess on 2018-01-05:
I reformatted your question to enable syntax highlighting (it's easier to read) and I included a link to the section of the tutorial that you're asking about (it's a good idea to link to anything you're asking about).

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Even though the node's source declared the name as turtle_tf_broadcaster, roslaunch allows you to rename a node using the <node> tag's name attribute. This way you can run multiple instances of the same node. If you tried to run multiple instances of a node with the same name you'd get a warning stating

[ WARN] [1486130761.721137111]: Reason given for shutdown: [new node registered with same name]

The roslaunch section of the wiki explains what the respawn attribute does

respawn="true"(optional)

Restart the node automatically if it quits.

So, if you're node dies for some reason it will automatically be restarted if you include the respawn attribute.


Originally posted by jayess with karma: 6155 on 2018-01-05

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.