ToolModel.iter_chain

ToolModel.iter_chain(start=None, end=None)[source]

Iterator over the chain of all elements between a pair of start and end elements.

Parameters
  • start (str, optional) – Name of the starting element of the chain. Defaults to the root link name.

  • end (str, optional) – Name of the final element of the chain. Defaults to the name of the last element.

Returns

Iterator of the chain of links and joints (names).

Examples

>>> robot = RobotModel.ur5()
>>> list(robot.iter_chain('world', 'forearm_link'))
['world', 'world_joint', 'base_link', 'shoulder_pan_joint', 'shoulder_link', 'shoulder_lift_joint', 'upper_arm_link', 'elbow_joint', 'forearm_link']