ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Joint_state_publisher syntax error in urdf_tutorial

asked 2013-07-19 02:36:59 -0600

LordTimmeh gravatar image

updated 2014-01-28 17:17:19 -0600

ngrennan gravatar image

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/", line 1931, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/", 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?

edit retag flag offensive close merge delete


I have the same problem. I am using ROS groovy and Ubuntu 12.04;

EduardoMaciel gravatar image EduardoMaciel  ( 2013-07-20 10:37:03 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-26 00:14:56 -0600

LordTimmeh gravatar image

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.

edit flag offensive delete link more

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


Asked: 2013-07-19 02:36:59 -0600

Seen: 545 times

Last updated: Jul 26 '13