Robot.constraints_from_frame
-
Robot.
constraints_from_frame
(frame_WCF, tolerance_position, tolerances_axes, group=None)[source] Returns a position and orientation constraint on 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) – The planning group for which we specify the constraint. Defaults to the robot’s main planning group.
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)]
Notes
There are many other possibilities of how to create a position and orientation constraint. Checkout
compas_fab.robots.PositionConstraint
andcompas_fab.robots.OrientationConstraint
.