OrientationConstraint
- class compas_fab.robots.OrientationConstraint[source]
Bases:
Constraint
Constrains a link to be within a certain orientation.
- Parameters:
- link_name
str
The name of the link this contraint refers to.
- quaternion
list
offloat
The desired orientation of the link specified by a quaternion in the order of
[w, x, y, z]
.- tolerances
list
offloat
, optional Error tolerances \(t_{i}\) for each of the frame’s axes. If only one value is passed it will be used for all 3 axes. The respective bound to be achieved is \((a_{i} - t_{i}, a_{i} + t_{i})\). Defaults to
[0.01, 0.01, 0.01]
.- weight
float
, optional A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to
1
.
- link_name
Notes
The rotation tolerance for an axis is defined by the other vector component values for rotation around corresponding axis.
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)
- Attributes:
- link_name
str
The name of the link this contraint refers to.
- quaternion
list
offloat
The desired orientation of the link specified by a quaternion in the order of
[w, x, y, z]
.- tolerances
list
offloat
Error tolerances \(t_{i}\) for each of the frame’s axes. If only one value is passed it will be used for all 3 axes. The respective bound to be achieved is \((a_{i} - t_{i}, a_{i} + t_{i})\).
- weight
float
A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important.
- link_name
Methods
Create a copy of this
OrientationConstraint
.Create an
OrientationConstraint
from a frame on the group's end-effector link.Transform the volume using a
compas.geometry.Transformation
.Inherited Methods
Converts the instance to a string.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Scale the
Constraint
.Get a scaled copy of this
Constraint
.Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Validate the data against the object's data schema.