clemense / yourdfpy

Python parser for URDFs
MIT License
127 stars 13 forks source link

Issue with FK in the presence of <mimic> joint tags #1

Closed caelan closed 2 years ago

caelan commented 2 years ago

For example, for a Franka Panda robot: https://github.com/caelan/pybullet-planning/blob/b280cfc578479309a15a5e4023a1bacf29eb25ee/models/franka_description/robots/panda_arm_hand.urdf#L222

Note that the error disappears when I remove the tag

File "/home/caelan/Programs/SRL/srl/venv/lib/python3.7/site-packages/yourdfpy/urdf.py", line 776, in load return URDF(robot=URDF._parse_robot(xml_element=xml_root), **kwargs) File "/home/caelan/Programs/SRL/srl/venv/lib/python3.7/site-packages/yourdfpy/urdf.py", line 440, in __init__ force_single_geometry_per_link=force_mesh, File "/home/caelan/Programs/SRL/srl/venv/lib/python3.7/site-packages/yourdfpy/urdf.py", line 1077, in _create_scene matrix, _ = self._forward_kinematics_joint(j) File "/home/caelan/Programs/SRL/srl/venv/lib/python3.7/site-packages/yourdfpy/urdf.py", line 837, in _forward_kinematics_joint self._cfg[mimic_joint_index] * joint.mimic.multiplier IndexError: index 9 is out of bounds for axis 0 with size 8

clemense commented 2 years ago

Thanks! Will add a test and a fix for that.