Ask Your Question

How do I visualize the URDF models of the NXT robots?

asked 2011-11-11 03:19:08 -0500

Capelare gravatar image

updated 2014-01-28 17:10:46 -0500

ngrennan gravatar image

Hi, I'm trying to visualize the URDF models of the nxt_robots (robot.urdf files on each package) with the display.launch program from the urdf_tutorials stack, but I don't seem to be able to do so, it keeps crashing all the time:

started core service [/rosout]
process[joint_state_publisher-2]: started with pid [2754]
process[robot_state_publisher-3]: started with pid [2759]
process[rviz-4]: started with pid [2762]
Traceback (most recent call last):
  File "/home/capelare/ros/urdf_tools/joint_state_publisher/joint_state_publisher", line 208, in <module>
    jsp = JointStatePublisher()
  File "/home/capelare/ros/urdf_tools/joint_state_publisher/joint_state_publisher", line 25, in __init__
    robot = URDF().parse(description)
  File "/home/capelare/ros/urdf_tools/urdf_python/src/urdf_python/", line 506, in parse
    base = xml.dom.minidom.parseString(xml_string)
  File "/usr/lib/python2.7/xml/dom/", line 1924, 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: not well-formed (invalid token): line 2, column 12
[joint_state_publisher-2] process has died [pid 2754, exit code 1].
log files: /home/capelare/.ros/log/b0629bba-0bad-11e1-93ed-001d4ffc607c/joint_state_publisher-2*.log

That's what I get on the Terminal. Then rviz opens and displays all the meshes on the origin. Any ideas? Too many joints, maybe? The robot.urdf file passes the check_urdf tool, so I guess the syntax is OK. BTW, display.launch works fine with the urdf files I made following the urdf_tutorials, if you're wondering.

I'm still getting used to ros, urdf, rviz... and I tried to make this work by myself, so maybe this is the stupidest problem ever, but I'm totally lost.

Also, as requested by David Lu, here you have the first few lines of the URDF file:

<!--this file was autogenerated from sensor_car.lxf -->
<robot name=sensor_car>

    <link name="base_link"/>
    <joint name="base_joint" type="fixed">
      <parent link="base_link"/>
      <child link="ref_0_link"/>
      <origin xyz="0.024 0 0.016" rpy="0 0 -1.57079632679" />
      <axis xyz="0 0 1" />

Thanks for your time, Miguel :)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2011-11-13 08:32:28 -0500

David Lu gravatar image

Put sensor_car in quotes.

edit flag offensive delete link more


Seriously? Well, it seems like that solved the problem, thanks :)
Capelare gravatar image Capelare  ( 2011-11-13 08:41:30 -0500 )edit

answered 2014-07-29 03:07:03 -0500

MaxR gravatar image

Another hint especially for Germans or other nationalities with weird letters like ä, ö, ü who came here like me, looking for an answer why their joint_state_publisher dies: If your joint_state_publisher dies in a smiliar way like this:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 59: ordinal not in range(128)

then there might be a problem that you used those Umlaute in your URDF-File. I had the this problem and it took me a while to find it, because check_urdf does not care about those letters and parses just fine, but the joint_state_publisher can't handle our fancy letters.

edit flag offensive delete link more


Hi Max. Can you please open an issue here: with a nice simple example so that this can get looked into? Thanks!

David Lu gravatar image David Lu  ( 2014-07-29 09:05:47 -0500 )edit

I'll look into it! I never submitted something to the github issues, so I'll have to read up on how to do that in a correct way.

MaxR gravatar image MaxR  ( 2014-07-29 09:40:04 -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


Asked: 2011-11-11 03:19:08 -0500

Seen: 789 times

Last updated: Jul 29 '14