Ask Your Question
1

How to read a urdf in python in Indigo?

asked 2014-11-17 11:17:12 -0500

lucasw gravatar image

updated 2014-11-17 11:26:31 -0500

http://wiki.ros.org/urdf_parser_py doesn't answer the question because it ends with Fuerte, I believe because the functionality was moved into urdfdom, but there isn't much documentation at http://wiki.ros.org/urdfdom .

Trying to run the Fuerte example with loading from the parameter server produces an error:

 Traceback (most recent call last):
   File "./parse_model.py", line 11, in <module>
     roslib.load_manifest('urdf_parser_py')
   File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest
     sys.path = _generate_python_path(package_name, _rospack) + sys.path
   File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path
     m = rospack.get_manifest(pkg)
   File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 159, in get_manifest
     return self._load_manifest(name)
   File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 198, in _load_manifest
     retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
   File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 190, in get_path
     raise ResourceNotFound(name, ros_paths=self._ros_paths)
 rospkg.common.ResourceNotFound: urdf_parser_py
 ROS path [0]=/opt/ros/indigo/share/ros
 ROS path [1]=/home/lucasw/catkin_ws/src
 ROS path [2]=/opt/ros/indigo/share
 ROS path [3]=/opt/ros/indigo/stacks

Commenting out the load manifest then produces:

AttributeError: type object 'Robot' has no attribute 'load_from_parameter_server'
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-11-17 11:24:11 -0500

lucasw gravatar image

updated 2014-11-17 11:27:18 -0500

From looking at the source https://github.com/ros/urdfdom/blob/m... it looks like 'load_from_parameter_server' has become 'from_parameter_server', so the complete example looks like:

import roslib
import rospy

from urdf_parser_py.urdf import URDF

robot = URDF.from_parameter_server()

print(robot)
edit flag offensive delete link more

Comments

I noticed an odd warning about 'upper' if a <limit> without an upper is provided, only the urdf parser generated a warning (The rest of the system worked fine though it wasn't clear if the other limits were working or silently ignored).

lucasw gravatar imagelucasw ( 2014-11-19 16:01:56 -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: 2014-11-17 11:17:12 -0500

Seen: 632 times

Last updated: Nov 17 '14