RobotModel.compute_transformations

RobotModel.compute_transformations(joint_state, link=None, parent_transformation=None)[source]

Recursive function to calculate the transformations of each joint.

Parameters
  • joint_state (dict) – A dictionary with the joint names as keys and values in radians and meters (depending on the joint type).

  • link (compas.robots.Link) – Link instance to calculate the child joint’s transformation.

  • parent_transformation (Transformation) – The transfomation of the parent joint.

Returns

dict of str (Transformation) – A dictionary with the joint names as keys and values are the joint’s respective transformation.

Examples

>>> names = robot.get_configurable_joint_names()
>>> values = [-2.238, -1.153, -2.174, 0.185, 0.667, 0.000]
>>> joint_state = dict(zip(names, values))
>>> transformations = robot.compute_transformations(joint_state)