Phylliade / ikpy

An Inverse Kinematics library aiming performance and modularity

Home Page:http://phylliade.github.io/ikpy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'NoneType' object has no attribute 'attrib'

Carpetfizz opened this issue · comments

commented

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

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-36-91ab49d6370e> in <module>
----> 1 ur10_chain = ikpy.chain.Chain.from_urdf_file("bot.urdf")

/miniconda3/lib/python3.6/site-packages/ikpy/chain.py in from_urdf_file(cls, urdf_file, base_elements, last_link_vector, base_element_type, active_links_mask, name)
    155             base_elements = ["base_link"]
    156 
--> 157         links = URDF_utils.get_urdf_parameters(urdf_file, base_elements=base_elements, last_link_vector=last_link_vector, base_element_type=base_element_type)
    158         # Add an origin link at the beginning
    159         return cls([link_lib.OriginLink()] + links, active_links_mask=active_links_mask, name=name)

/miniconda3/lib/python3.6/site-packages/ikpy/URDF_utils.py in get_urdf_parameters(urdf_file, base_elements, last_link_vector, base_element_type)
    152         if node_type == "link":
    153             # Current element is a link, find child joint
--> 154             (has_next, current_joint) = find_next_joint(root, current_link, next_element)
    155             node_type = "joint"
    156             if has_next:

/miniconda3/lib/python3.6/site-packages/ikpy/URDF_utils.py in find_next_joint(root, current_link, next_joint_name)
     48             # FIXME: We are not sending a warning when we have two children for the same link
     49             # Even if this is not possible, we should ensure something coherent
---> 50             if joint.find("parent").attrib["link"] == current_link_name:
     51                 has_next = True
     52                 next_joint = joint

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.

Hey @Carpetfizz, could you paste your URDF?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.