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

robot_state_publisher can find 'robot' element

asked 2013-07-22 22:44:31 -0600

LordTimmeh gravatar image

updated 2013-07-25 01:57:58 -0600

I am trying to load a simple urdf file into rviz. According to the urdf tutorials I need to start the robot_state_publisher and the joint_state_publisher, but when I start the robot_state_publisher on the following file I get an error.

The urdf file:

<?xml version="1.0"?>
<robot name="bobby">
  <link name="base_link">
        <box size="0.65 0.72 0.25"/>

When I then run the following command:

rosparam set robot_description bobby.urdf
rosrun robot_state_publisher robot_state_publisher

The error that I get is:

[ERROR] [1374568528.590558816]: Could not find the 'robot' element in the xml file
[ERROR] [1374568528.590988619]: Could not generate robot model
[ERROR] [1374568528.591074594]: Failed to extract kdl tree from xml robot description

I am using groovy on 13.04 Can someone tell me what I am doing wrong?

edit retag flag offensive close merge delete


Can you add the commands you ran?

thebyohazard gravatar image thebyohazard  ( 2013-07-23 05:44:41 -0600 )edit

I have added my commands to the original question.

LordTimmeh gravatar image LordTimmeh  ( 2013-07-25 01:58:18 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-07-23 03:53:04 -0600

thebyohazard gravatar image

updated 2013-07-25 04:17:09 -0600

Your robot needs a name. Replace the first line with something like

<robot name="robot">


The command rosparam set robot_description bobby.urdf actually sets robot_description to the string "bobby.urdf". What you want is the actual contents of the xml file there instead. Try instead

rosparam set robot_description --textfile bobby.urdf

edit flag offensive delete link more


I tried this, when I do, I get the same error. (I changed it in my original post)

LordTimmeh gravatar image LordTimmeh  ( 2013-07-23 05:08:45 -0600 )edit

Thank you, this fixed my problem. I was indeed passing it the filename, Doe i also have to do this for the join_state_publisher?

LordTimmeh gravatar image LordTimmeh  ( 2013-07-25 04:46:47 -0600 )edit

It looks to be the same for joint_state_publisher, and I don't imagine the authors would want to have to switch formats for robot_description. It's been a while since I used it though, so I can't tell you for sure.

thebyohazard gravatar image thebyohazard  ( 2013-07-25 05:17:12 -0600 )edit

Yip, `robot_description` is the same for every node and has to contain the full XML structure.

felix k gravatar image felix k  ( 2013-07-25 06:06:42 -0600 )edit

Ah thanks, everything is clear now. I interpreted the wiki as meaning the file instead of the text.

LordTimmeh gravatar image LordTimmeh  ( 2013-07-26 00:08:54 -0600 )edit

The node on the other networked machine wants to use `robot_description` and cannot use any local file path. Think big =]

felix k gravatar image felix k  ( 2013-07-26 05:30:32 -0600 )edit

answered 2013-07-23 05:47:35 -0600

David Lu gravatar image

Try adding this as the first line.

<?xml version="1.0"?>
edit flag offensive delete link more


I have addes this to the code, but the effects are still the same.

LordTimmeh gravatar image LordTimmeh  ( 2013-07-25 01:55:33 -0600 )edit

Question Tools

1 follower


Asked: 2013-07-22 22:44:31 -0600

Seen: 1,887 times

Last updated: Jul 25 '13