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

Revision history [back]

Hello @pitosalas,

My guess is that you forgot to add the listener node tag to the launch file.

After the instruction:

2. Running the listener With your text editor, open the launch file called start_demo.launch, and add the following lines:

It must to be like that:

<launch>
    <!-- Turtlesim Node-->
    <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
    <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>

    <node name="turtle1_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle1" />
    </node>
    <node name="turtle2_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle2" /> 
    </node>
    <node pkg="learning_tf" type="turtle_tf_listener.py" name="listener" />
  </launch>

Hope it can help you!

Cheers

Hello @pitosalas,

My guess is that you forgot to add the listener node tag to the launch file.

After the instruction:

2. Running the listener With your text editor, open the launch file called start_demo.launch, and add the following lines:

It must to be like that:

<launch>
    <!-- Turtlesim Node-->
    <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
    <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>

    <node name="turtle1_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle1" />
    </node>
    <node name="turtle2_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle2" /> 
    </node>
    <node pkg="learning_tf" type="turtle_tf_listener.py" name="listener" />
  </launch>

The turtle_tf_listener is the node that spawns the second turtle (lines 16 and 17)

  16     spawner = rospy.ServiceProxy('spawn', turtlesim.srv.Spawn)
  17     spawner(4, 2, 0, 'turtle2')

Hope it can help you!

Cheers