deebuls / youbot_pykdl

Python KDL interface for Youbot robot
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Error on URDF #1

Open cadop opened 8 years ago

cadop commented 8 years ago

When running the example code, or even just executing the initialization without ros node, this error appears:


youbot@ubuntu:~/Tiling/Ros_Tests$ python KDL_testing.py
FROM STRING
Scalar element defined multiple times: limitUnknown tag: hardwareInterfaceTraceback (most recent call last):
  File "KDL_testing.py", line 11, in <module>
    main()
  File "KDL_testing.py", line 7, in main
    kin = youbot_kinematics(open('youbot.urdf').read())
  File "/usr/local/lib/python2.7/dist-packages/youbot_pykdl/youbot_pykdl.py", line 50, in __init__
    self._youbot = URDF.from_xml_string(urdf)
  File "/usr/local/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 486, in from_xml_string
    return cls.from_xml(node)
  File "/usr/local/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 481, in from_xml
    return cur_type.from_xml(node)
  File "/usr/local/lib/python2.7/dist-packages/urdf_parser_py/xml_reflection/core.py", line 171, in from_xml
    obj.read_xml(node)
  File "/usr/local/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 "/usr/local/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 "/usr/local/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 "/usr/local/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: no hardwareInterface defined

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

The code is


import sys
import rospy
from youbot_pykdl import youbot_kinematics

def main():

    kin = youbot_kinematics(open('youbot.urdf').read())
    sys.exit()

if __name__ == "__main__":
    main()

I have tried with roscore running and without it running, same error. I have also tried the if/else statement for the parameter, but that also does not work. What would be the problem?

cadop commented 8 years ago

Additionally, This code:

import sys
import rospy
from youbot_pykdl import youbot_kinematics

def main():

    rospy.init_node('youbot_kinematics')
    print '*** Youbot PyKDL Kinematics ***\n'
    kin = youbot_kinematics()

    print '\n*** Youbot Description ***\n'
    kin.print_robot_description()
    print '\n*** Youbot KDL Chain ***\n'
    kin.print_kdl_chain()

if __name__ == "__main__":
    main()

Creates this error when roscore is running

youbot@ubuntu:~/Tiling/Ros_Tests$ python KDL_testing.py
*** Youbot PyKDL Kinematics ***

FROM PARAM SERVER
Traceback (most recent call last):
  File "KDL_testing.py", line 17, in <module>
    main()
  File "KDL_testing.py", line 9, in main
    kin = youbot_kinematics()
  File "/usr/local/lib/python2.7/dist-packages/youbot_pykdl/youbot_pykdl.py", line 47, in __init__
    self._youbot = URDF.from_parameter_server(key='robot_description')
  File "/usr/local/lib/python2.7/dist-packages/urdf_parser_py/urdf.py", line 471, in from_parameter_server
    return cls.from_xml_string(rospy.get_param(key))
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/client.py", line 452, in get_param
    return _param_server[param_name] #MasterProxy does all the magic for us
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rospy/msproxy.py", line 117, in __getitem__
    raise KeyError(key)
KeyError: 'robot_description'