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

Don't understand how to parse URDF file

asked 2015-08-11 09:00:10 -0500

Metalzero2 gravatar image

Hello all,

I am using Ubuntu 12.04 with ROS Indigo.

So I am following the URDF tutorial (Create your own urdf file) but after I create my .urdf file I don't understand how to parse it. The file is located in



  • catkin_ws -- my ROS workspace
  • learning_urdf -- a package I created for this tutorial

the code in the robot.urdf is

<robot name="test_robot">
  <link name="link1" />
  <link name="link2" />
  <link name="link3" />
  <link name="link4" />

  <joint name="joint1" type="continuous">
    <parent link="link1"/>
    <child link="link2"/>

  <joint name="joint2" type="continuous">
    <parent link="link1"/>
    <child link="link3"/>

  <joint name="joint3" type="continuous">
    <parent link="link3"/>
    <child link="link4"/>

and finally I run the command:

check_urdf robot.urdf

and get this error:

Error:   Error document empty.
         at line 72 in /build/buildd/urdfdom-0.2.10+dfsg/urdf_parser/src/model.cpp
ERROR: Model Parsing the xml failed

Looking more I found this but still not sure what to do. Do I need to run a command similar to this

rosrun xacro rospack find pr2_description/robots/pr2.urdf.xacro -o /tmp/pr2.urdf

Do I need to first convert it to a xarco or somthing?

Where does to urdf file need to be for the command to run?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-11 10:08:41 -0500

Akif gravatar image

You can run check_urdf /home/<user_name>/ROS/catkin_ws/src/learning_urdf/urdf/robot.urdf to parse your file. Path of your urdf file should be supplied or you should be in the same directory before running check_urdf.

edit flag offensive delete link more


@UnfoX somebody needs to add that in the tutorial. Thanks very much for your help :)

Metalzero2 gravatar image Metalzero2  ( 2015-08-11 11:25:47 -0500 )edit

I am facing same problem and i tried with full path name but still failed.

RAHUL AGRAWAL gravatar image RAHUL AGRAWAL  ( 2016-04-13 11:47:14 -0500 )edit

@RAHUL AGRAWAL, what is your command and console output?

Akif gravatar image Akif  ( 2016-04-19 01:04:13 -0500 )edit

I had the same problem, but it works now. i just went in the directory and after i run check_urdf my_robot.urdf.thank you really

Soul Goumey gravatar image Soul Goumey  ( 2017-05-09 07:30:10 -0500 )edit

@Soul Goumey, You're welcome!

Akif gravatar image Akif  ( 2017-05-10 02:48:45 -0500 )edit

Question Tools

1 follower


Asked: 2015-08-11 09:00:10 -0500

Seen: 3,505 times

Last updated: Aug 11 '15