Robot.orientation_constraint_from_frame
- Robot.orientation_constraint_from_frame(frame_WCF, tolerances_axes, group=None, use_attached_tool_frame=True)[source]
Create an orientation constraint from a frame on the group’s end-effector link.
- Parameters
frame_WCF (
compas.geometry.Frame
) – The frame from which we create the orientation constraint.tolerances_axes (
list
offloat
) – 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) – IfTrue
and there is a tool attached to the planning group, it will use its TCF instead of the T0CF to create the constraints. Defaults toTrue
.
- Returns
- Raises
ValueError – If tolerance axes given are not one or three values.
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]) >>> tolerances_axes = [math.radians(1)] * 3 >>> group = robot.main_group_name >>> robot.orientation_constraint_from_frame(frame, tolerances_axes, group=group) OrientationConstraint('ee_link', [0.5, 0.5, 0.5, 0.5], [0.017453292519943295, 0.017453292519943295, 0.017453292519943295], 1.0)