Ask Your Question
0

tf tutorial start_demo.launch wtf

asked 2017-09-14 16:59:11 -0500

 <launch>
  <!-- Turtlesim Node-->

      <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
      <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>


        <param name="turtle" type="string" value="turtle1" />
      </node>

        <param name="turtle" type="string" value="turtle2" /> 
      </node>

    </launch>

What is wrong with this launch file? and I don't mean the spacing, I have reformatted it a bunch and already know xml formatting has to be spaced right and all that. it's got to be the code itself, which is directly from http://wiki.ros.org/tf/Tutorials/Writ... tf tutorial and I'm surprised I only saw one unanswered question about this issue, but I assume it's because the others know how to make xml syntax correct and just moved on.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2017-09-14 17:08:55 -0500

tfoote gravatar image

updated 2017-09-14 17:40:03 -0500

You're missing a lot of the content of the launch file in the tutorial. In particular two of the four node elements (and only have the close elements). Make sure you're copying the whole file.

Copying from the tutorial it looks like this:

  <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>

  </launch>

Edit: here's how it renders: image description

edit flag offensive delete link more

Comments

well thats weird. mine doesn't include all that... you copied this from the same page I linked? maybe its chromium.. it does sometimes do weird things. so strange though.. that was copied from right under '2. Running the Broadcaster'? @tfoote ? thank you

moonspacedancer gravatar imagemoonspacedancer ( 2017-09-14 17:16:39 -0500 )edit
0

answered 2017-09-14 17:13:51 -0500

jayess gravatar image

updated 2017-09-14 17:21:04 -0500

Are you sure you copy and pasted it correctly? The problem is that you're missing some of the node tags. Turn this

<launch>
    <!-- Turtlesim Node-->

    <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
    <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>

    <!-- Missing opening <node> -->
        <param name="turtle" type="string" value="turtle1" />
    </node>

    <!-- Missing opening <node> -->
        <param name="turtle" type="string" value="turtle2" /> 
    </node>

</launch>

into this

<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>

</launch>

Notice how you're missing two

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

Edit:

To create a proper XML you need to have:

  • both opening and closing tags (e.g. <node> and </node>, respectively), or
  • self-closing tags (e.g., <node/> note the / before the >)

If you don't properly open and close tags then your file is not properly formatted and you'll get an error.

edit flag offensive delete link more

Comments

yeah but are you saying you see all this text in that tutorial for the launch file or did you get this from a different page? @tfoote

moonspacedancer gravatar imagemoonspacedancer ( 2017-09-14 17:20:11 -0500 )edit

I got this from the link that you posted. I literally clicked the link, copied the code, came back here and pasted it into my answer.

jayess gravatar imagejayess ( 2017-09-14 17:21:39 -0500 )edit

I copy and pasted this code: http://wiki.ros.org/tf/Tutorials/Writ...

jayess gravatar imagejayess ( 2017-09-14 17:23:32 -0500 )edit
-1

answered 2017-09-14 17:22:34 -0500

updated 2017-09-14 17:24:44 -0500

Ok wow, well apparently Chromium on Ubuntu is quite unstable as I just checked with Mozilla and the full text indeed shows up. how strange... thank you @tfoote and @jayess I have been troubleshooting this for 5 hours now haha

edit flag offensive delete link more

Comments

1

Although your problem has been solved, you should select @tfoote's or my answer as the correct one. This one doesn't solve the problem...

jayess gravatar imagejayess ( 2017-09-14 17:25:22 -0500 )edit
1

I'm not sure that's the right attribution for your problem. I was using chromium under ubuntu as well.

tfoote gravatar imagetfoote ( 2017-09-14 17:37:09 -0500 )edit

@tfoote oh wow. now that is very interesting. I can't see what else to consider there since it only shows me the full text you shared when I open the tutorial on Mozilla.

moonspacedancer gravatar imagemoonspacedancer ( 2017-09-14 17:40:39 -0500 )edit

@jayess it does solve the problem for me to switch to Mozilla as I state in the answer I accepted. thank you for your helpful insight though!

moonspacedancer gravatar imagemoonspacedancer ( 2017-09-14 17:48:32 -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

1 follower

Stats

Asked: 2017-09-14 16:59:11 -0500

Seen: 50 times

Last updated: Sep 14 '17