Ask Your Question
0

robot_state_publisher can find 'robot' element

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

LordTimmeh gravatar image

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

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">
    <visual>
      <geometry>
        <box size="0.65 0.72 0.25"/>
      </geometry>
    </visual>
  </link>
</robot>

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

Comments

Can you add the commands you ran?

tbh gravatar image tbh  ( 2013-07-23 05:44:41 -0500 )edit

I have added my commands to the original question.

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

2 Answers

Sort by ยป oldest newest most voted
1

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

tbh gravatar image

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

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

<robot name="robot">

EDIT:

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

Comments

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 -0500 )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 -0500 )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.

tbh gravatar image tbh  ( 2013-07-25 05:17:12 -0500 )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 -0500 )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 -0500 )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 -0500 )edit
1

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

David Lu gravatar image

Try adding this as the first line.

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

Comments

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

LordTimmeh gravatar image LordTimmeh  ( 2013-07-25 01:55:33 -0500 )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: 2013-07-22 22:44:31 -0500

Seen: 1,107 times

Last updated: Jul 25 '13