Rosanswers logo

I am trying to follow the urdf tutorial found at /wiki/urdf/Tutorials/Building a Visual Robot Model with URDF from Scratch (sorrie can't post links)

But whenever I try to start the display of the first model using:

roslaunch urdf_tutorial display.launch model:=01-myfirst.urdf

Rviz crashes. In order to find my problem I tried to start everything manually, but when I run rosrun joint_state_publisher joint_state_publisher _robot_description:=01-myfirst.urdf. I get the following error:

Traceback (most recent call last):
  File "/opt/ros/groovy/stacks/robot_model_visualization/joint_state_publisher/joint_state_publisher", line 202, in <module>
    jsp = JointStatePublisher()
  File "/opt/ros/groovy/stacks/robot_model_visualization/joint_state_publisher/joint_state_publisher", line 25, in __init__
    robot = xml.dom.minidom.parseString(description).getElementsByTagName('robot')[0]
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1931, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0

I haven't been able to find this syntax error, as I am directly using the xml file from the tutorial page.

I am using Groovy on Ubuntu 13.04.

Does someone know how to fix this?

Originally posted by LordTimmeh on ROS Answers with karma: 18 on 2013-07-19

Post score: 0

Original comments

Comment by EduardoMaciel on 2013-07-20:
I have the same problem. I am using ROS groovy and Ubuntu 12.04;


1 Answer 1


Rosanswers logo

I have found the problem (and the solution).

joint_state_publisher requires not the name of the file, but the actual text. So it was trying to parse the text 01-myfirst.urdf as xml file.

So I now set the robot_description parameter using

rosparam set robot_description --textfile=01-myfirst.urdf

And now it workts.

Originally posted by LordTimmeh with karma: 18 on 2013-07-26

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

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