PositionConstraint.from_frame
- classmethod PositionConstraint.from_frame(frame_WCF, tolerance_position, link_name, tool_coordinate_frame=None, weight=1.0)[source]
Create a
PositionConstraint
from a frame on the group’s end-effector link. Only the position of the frame is considered for the constraint.- 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).
- link_name
str
The name of the end-effector link. Necessary for creating the position constraint.
- tool_coordinate_frame
compas.geometry.Frame
, optional The tool tip coordinate frame relative to the flange of the robot. If not specified, the target frame is relative to the robot’s flange.
- weight
float
A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to
1
.
- frame_WCF
- Returns:
See also
Examples
>>> robot = RobotLibrary.ur5() >>> frame = Frame([0.4, 0.3, 0.4], [0, 1, 0], [0, 0, 1]) >>> tolerance_position = 0.001 >>> group = robot.main_group_name >>> end_effector_link_name = robot.get_end_effector_link_name(group) >>> PositionConstraint.from_frame(frame, tolerance_position, end_effector_link_name) PositionConstraint('tool0', BoundingVolume(2, Sphere(Point(0.400, 0.300, 0.400), 0.001)), 1.0)