ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
1

Problem with python parser URDF

asked 2015-07-22 08:07:50 -0500

j.macanas gravatar image

Hi everyone,

I'm having some troubles extracting the information of a URDF file from the parameter server. In the launch file I load the robot in the parameter server with no problem or warning, in the usual way. The problem comes when I use the next instruction in my Python script:

self.urdf = URDF.from_parameter_server(key='robot_description')

Then in the terminal raises the following exception and the node dies:

[INFO] [WallTime: 1437558450.270437] [0.000000] Starting [jt_cartesian_controller] node
Material has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureTraceback (most recent call last):
  File "/home/joaquin/CERN/TFM_WS/src/youbot-phantom-omni/cartesian_controllers/scripts/jt_cartesian_controller.py", line 101, in <module>
    jtc = JTCartesianController()
  File "/home/joaquin/CERN/TFM_WS/src/youbot-phantom-omni/cartesian_controllers/scripts/jt_cartesian_controller.py", line 34, in __init__
    self.urdf = URDF.from_parameter_server(key='robot_description')
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/urdf.py", line 450, in from_parameter_server
    return cls.from_xml_string(rospy.get_param(key))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 486, in from_xml_string
    return cls.from_xml(node)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 481, in from_xml
    return cur_type.from_xml(node)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 171, in from_xml
    obj.read_xml(node)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 474, in read_xml
    self.XML_REFL.set_from_xml(self, node)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 406, in set_from_xml
    element.add_from_xml(obj, child)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 312, in add_from_xml
    value = self.value_type.from_xml(node)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 220, in from_xml
    raise Exception(out)
Exception: Could not perform duck-typed parsing.
Value Type: <class 'urdf_parser_py.urdf.Transmission'>
Exception: Required element not set in XML: hardwareInterface

Value Type: <class 'urdf_parser_py.urdf.PR2Transmission'>
Exception: Required attribute not set in XML: type

I have checked the URDF file, and also the xacro files where transmission is defined. And everything seems to be correct. Which could be the problem with the parsing of the robot?

Note: I'm using Ubuntu 14.04.02 and ROS Indigo. The robot loaded is the Schunk LWA4P, whose package can be found in these repositories: schunk_robots schunk_modular_robotics

Thank you in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-23 07:19:18 -0500

j.macanas gravatar image

A friend has helped me and it is due a bug in the python parser, where the type has to be defined twice in the xacro file, like this:

<transmission name="${name}_1_trans" type="transmission_interface/SimpleTransmission">
  <type>transmission_interface/SimpleTransmission</type>
  <joint name="${name}_1_joint">
    <hardwareInterface>PositionJointInterface</hardwareInterface>
    <hardwareInterface>VelocityJointInterface</hardwareInterface>
  </joint>
  <actuator name="${name}_1_motor">
    <mechanicalReduction>1</mechanicalReduction>
  </actuator>
</transmission>

But now it still comes out with other parsing errors, referred now to the mechanical reduction. I have tried to define it twice and change its position, but no better solution is achieved. Any help?

edit flag offensive delete link more
0

answered 2015-07-22 08:45:51 -0500

cyborg-x1 gravatar image

I guess multiple material tags have a problem:

[INFO] [WallTime: 1437558450.270437] [0.000000] Starting [jt_cartesian_controller] node
Material has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureMaterial has neither a color nor textureTraceback (most recent call last):

textureMaterial has neither a color nor textureMaterial

try removing that materials and see if that fixes your problem, maybe you have some empty material tags???

edit flag offensive delete link more

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-07-22 08:06:54 -0500

Seen: 363 times

Last updated: Jul 23 '15