PositionConstraint
- class compas_fab.robots.PositionConstraint[source]
Bases:
ConstraintConstrains a link to be within a certain bounding volume.
- Parameters:
- link_name
str The name of the link this contraint refers to.
- bounding_volume
BoundingVolume The volume this constraint refers to.
- 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
Examples
>>> from compas.geometry import Sphere >>> from compas_fab.robots import PositionConstraint >>> from compas_fab.robots import BoundingVolume >>> bv = BoundingVolume.from_sphere(Sphere(0.5, point=[3,4,5])) >>> pc = PositionConstraint('link_0', bv, weight=1.)
- Attributes:
- link_name
str The name of the link this contraint refers to.
- bounding_volume
BoundingVolume The volume this constraint refers to.
- 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
PositionConstraint.Create a
PositionConstraintfrom acompas.geometry.Box.Create a
PositionConstraintfrom a frame on the group's end-effector link.Create a
PositionConstraintfrom acompas.datastructures.Mesh.Create a
PositionConstraintfrom a point.Create a
PositionConstraintfrom acompas.geometry.Sphere.Scale the
bounding_volumeuniformely.Transform the
bounding_volumeusing acompas.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.
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.