OrientationConstraint
-
class
compas_fab.robots.
OrientationConstraint
(link_name, quaternion, tolerances=None, weight=1.0)[source] Bases:
compas_fab.robots.constraints.Constraint
Constrains a link to be within a certain orientation.
-
link_name
The name of the link this contraint refers to.
- Type
string
-
quaternion
The desired orientation of the link specified by a quaternion in the order of [w, x, y, z].
- Type
list of float
-
tolerances
Error tolerances ti for each of the frame’s axes. The respective bound to be achieved is [ai - ti, ai + ti]. Defaults to [0.01, 0.01, 0.01].
- Type
list of float, optional
-
weight
A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to 1.
- Type
float, optional
Notes
If you specify the tolerance 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 can only change 0.01.
Examples
>>> from compas.geometry import Frame >>> from compas_fab.robots import OrientationConstraint >>> frame = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15]) >>> oc = OrientationConstraint("link_0", frame.quaternion)
Methods
__init__
(link_name, quaternion[, …])Initialize self.
copy
()scale
(scale_factor)transform
(transformation)Attributes
JOINT
ORIENTATION
POSITION
possible_types
-
__init__
(link_name, quaternion, tolerances=None, weight=1.0)[source] Initialize self. See help(type(self)) for accurate signature.
-