Ask Your Question
0

Don't understand how to parse URDF file

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

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

/home/<user_name>/ROS/catkin_ws/src/learning_urdf/urdf/robot.urdf

where:

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

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

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

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 xacro.py 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
9

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

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

Comments

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

Metalzero2 gravatar imageMetalzero2 ( 2015-08-11 11:25:47 -0600 )edit

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

RAHUL AGRAWAL gravatar imageRAHUL AGRAWAL ( 2016-04-13 11:47:14 -0600 )edit

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

Akif gravatar imageAkif ( 2016-04-19 01:04:13 -0600 )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 imageSoul Goumey ( 2017-05-09 07:30:10 -0600 )edit

@Soul Goumey, You're welcome!

Akif gravatar imageAkif ( 2017-05-10 02:48:45 -0600 )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: 2015-08-11 09:00:10 -0600

Seen: 2,463 times

Last updated: Aug 11 '15