Robot.constraints_from_frame

Robot.constraints_from_frame(frame_WCF, tolerance_position, tolerances_axes, group=None, use_attached_tool_frame=True)[source]

Create a position and an orientation constraint from a frame calculated for the group’s end-effector link.

Parameters
  • frame_WCF (compas.geometry.Frame) – The frame from which we create position and orientation constraints.

  • tolerance_position (float) – The allowed tolerance to the frame’s position (defined in the robot’s units).

  • tolerances_axes (list of float) – Error tolerances ti for each of the frame’s axes in radians. If only one value is passed it will be uses for all 3 axes.

  • group (str, optional) – The planning group for which we specify the constraint. Defaults to the robot’s main planning group.

  • use_attached_tool_frame (bool, optional) – If True and there is a tool attached to the planning group, it will use its TCF instead of the T0CF to create the constraints. Defaults to True.

Returns

list of Constraint

Notes

The rotation tolerance for an axis is defined by the other vector component values for rotation around corresponding axis. If you specify the tolerances_axes vector with [0.01, 0.01, 6.3], it means that the frame’s x-axis and y-axis are allowed to rotate about the z-axis by an angle of 6.3 radians, whereas the z-axis would only rotate by 0.01.

Examples

>>> frame = Frame([0.4, 0.3, 0.4], [0, 1, 0], [0, 0, 1])
>>> tolerance_position = 0.001
>>> tolerances_axes = [math.radians(1)]
>>> group = robot.main_group_name
>>> robot.constraints_from_frame(frame, tolerance_position, tolerances_axes, group) 
[PositionConstraint('ee_link', BoundingVolume(2, Sphere(Point(0.400, 0.300, 0.400), 0.001)), 1.0),
OrientationConstraint('ee_link', [0.5, 0.5, 0.5, 0.5], [0.017453292519943295, 0.017453292519943295, 0.017453292519943295], 1.0)]