TriPed-Robot / trip_kinematics

Python package for inverse kinematic calculations of hybrid serial parallel robots
https://trip-kinematics.readthedocs.io/en/main/
MIT License
28 stars 5 forks source link

Can't model robots with Transformations only #68

Closed rtyh12 closed 2 years ago

rtyh12 commented 2 years ago

If the first element of the list passed to Robot() is not a KinematicGroup, for example for modeling simple robots with no closed chains, the constructor fails.

Steps to reproduce: create two transformations and pass them to Robot().

shoulder_rot = Transformation(name='shoulder_rot', values={})
shoulder_tra = Transformation(name='shoulder_tra', parent=shoulder_rot, values={})

transformations = [shoulder_rot, shoulder_tra]
robot = Robot(transformations)

fails with the following error:

Exception has occurred: KeyError 'shoulder_tra'
  File "(...)\trip_kinematics\Robot.py", line 45, in __init__
    parent=self._group_dict[str(kinematic_chain[i-1])])

If the first element of the list is a Transformation, self._group_dict never gets set (as this only happens after the check).