Constraint

class compas_fab.robots.Constraint[source]

Bases: Data

Base class for robot constraints.

Parameters:
constraint_type

Constraint type, one of Constraint.CONSTRAINT_TYPES.

weightfloat, optional

A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to 1.

Notes

Constraint.JOINT

Joint constraint type.

Constraint.POSITION

Positional constraint type.

Constraint.ORIENTATION

Orientational constraint type.

Constraint.CONSTRAINT_TYPES

List of possible constraint types.

Attributes:
constraint_type

Constraint type, one of Constraint.CONSTRAINT_TYPES.

weightfloat

A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important.

Methods

copy

Create a copy of this Constraint.

scale

Scale the Constraint.

scaled

Get a scaled copy of this Constraint.

transform

Transform the Constraint.

Inherited Methods

ToString

Converts the instance to a string.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

validate_data

Validate the data against the object's data schema.