JointConstraint

class compas_fab.robots.JointConstraint(joint_name, value, tolerance_above=0.0, tolerance_below=0.0, weight=1.0)[source]

Bases: compas_fab.robots.constraints.Constraint

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

Parameters
  • joint_name (str) – The name of the joint this contraint refers to.

  • value (float) – The targeted value for that joint.

  • tolerance_above (float) – Tolerance above the targeted joint value, in radians. Defaults to 0.

  • tolerance_below (float) – Tolerance below the targeted joint value, in radians. Defaults to 0.

  • weight (float, optional) – A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important. Defaults to 1.

Attributes
  • joint_name (str) – The name of the joint this contraint refers to.

  • value (float) – The targeted value for that joint.

  • tolerance_above (float) – Tolerance above the targeted joint value, in radians.

  • tolerance_below (float) – Tolerance below the targeted joint value, in radians.

  • weight (float) – A weighting factor for this constraint. Denotes relative importance to other constraints. Closer to zero means less important.

Examples

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

Methods

__init__(joint_name, value[, …])

Initialize self.

copy()

Create a copy of this JointConstraint.

scale(scale_factor)

Scale (multiply) the constraint with a factor.

scaled(scale_factor)

Get a scaled copy of this Constraint.

transform(transformation)

Transform the Constraint.

Attributes

CONSTRAINT_TYPES

JOINT

ORIENTATION

POSITION