JointConstraint

class compas_fab.robots.JointConstraint[source]

Bases: Constraint

Constrains the value of a joint to be within a certain bound.

Parameters:
joint_namestr

The name of the joint this contraint refers to.

valuefloat

The targeted value for that joint.

tolerance_abovefloat

Tolerance above the targeted joint value, in radians. Defaults to 0.

tolerance_belowfloat

Tolerance below the targeted joint value, in radians. Defaults to 0.

weightfloat, optional

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

Examples

>>> from compas_fab.robots import JointConstraint
>>> jc = JointConstraint("joint_0", 1.4, 0.1, 0.1, 1.0)
Attributes:
joint_namestr

The name of the joint this contraint refers to.

valuefloat

The targeted value for that joint.

tolerance_abovefloat

Tolerance above the targeted joint value, in radians.

tolerance_belowfloat

Tolerance below the targeted joint value, in radians.

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 JointConstraint.

joint_constraints_from_configuration

Create joint constraints for all joints of the configuration.

scale

Scale (multiply) the constraint with a factor.

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.

scaled

Get a scaled copy of this Constraint.

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.

transform

Transform the Constraint.

validate_data

Validate the data against the object's data schema.