Phylliade / ikpy

An Inverse Kinematics library aiming performance and modularity
http://phylliade.github.io/ikpy
Apache License 2.0
695 stars 152 forks source link

'NoneType' object has no attribute 'attrib' #95

Closed kentykentykenty closed 3 years ago

kentykentykenty commented 3 years ago

I'm getting the following error when trying to import a chain defined by a URDF.

Traceback (most recent call last):
  File "/home/kenta/catkin_ws/src/ikpy/resources/cobotta/generate_chains.py", line 11, in <module>
    dot, urdf_tree = get_urdf_tree("./cobotta.urdf", out_image_path="./cobotta")
  File "/home/kenta/.local/lib/python3.5/site-packages/ikpy/urdf/utils.py", line 121, in get_urdf_tree
    _create_robot_tree_aux(dot, root, base_link, urdf_tree)
  File "/home/kenta/.local/lib/python3.5/site-packages/ikpy/urdf/utils.py", line 62, in _create_robot_tree_aux
    for next_joint in _get_next_joints(root, current_link):
  File "/home/kenta/.local/lib/python3.5/site-packages/ikpy/urdf/utils.py", line 9, in _get_next_joints
    current_link_name = current_link.attrib["name"]
AttributeError: 'NoneType' object has no attribute 'attrib'

I'm not too familiar with the URDF format, or ikpy's parser to figure out what this error means. Any suggestions on how to proceed would be much appreciated. This is my robot cobotta.urdf

<robot name="cobotta">
<!-- plugin for Gazebo -->
<gazebo>
</gazebo>
<link name="world"/>
<joint name="joint_w" type="fixed">
</joint>
<link name="base_link">
</link>
<link name="J1">
</link>
<joint name="joint_1" type="revolute">
</joint>
<transmission name="trans_1">
</transmission>
<link name="J2">
</link>
<joint name="joint_2" type="revolute">
</joint>
<transmission name="trans_2">
</transmission>
<link name="J3">
</link>
<joint name="joint_3" type="revolute">
</joint>
<transmission name="trans_3">
</transmission>
<link name="J4">
</link>
<joint name="joint_4" type="revolute">
</joint>
<transmission name="trans_4">
</transmission>
<link name="J5">
</link>
<joint name="joint_5" type="revolute">
</joint>
<transmission name="trans_5">
</transmission>
<link name="J6">
</link>
<joint name="joint_6" type="revolute">
</joint>
<transmission name="trans_6">
</transmission>
<link name="gripper_base">
</link>
<joint name="joint_gripper_base" type="fixed">
</joint>
<link name="left_finger">
</link>
<joint name="joint_gripper" type="prismatic">
</joint>
<transmission name="trans_gripper">
</transmission>
<link name="right_finger">
</link>
<joint name="joint_gripper_mimic" type="prismatic">
</joint>
</robot>
Phylliade commented 3 years ago

Hello @kentykentykenty,

Were you able to solve your issue?