Skip to content

Commit 87984a7

Browse files
Update constraints.py
1 parent 4e66cc4 commit 87984a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compas_fab/robots/constraints.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ class JointConstraint(Constraint):
157157
tolerance_above: float
158158
tolerance_below: float
159159
The bound to be achieved is [value - tolerance_below, position + tolerance_above].
160-
JointConstraint tolerances values must be positive.
161160
weight: float, optional
162161
A weighting factor for this constraint. Denotes relative importance to
163162
other constraints. Closer to zero means less important. Defaults to 1.
@@ -173,8 +172,8 @@ def __init__(self, joint_name, value, tolerance_above=0., tolerance_below=0., we
173172
super(JointConstraint, self).__init__(self.JOINT, weight)
174173
self.joint_name = joint_name
175174
self.value = value
176-
self.tolerance_above = tolerance_above
177-
self.tolerance_below = tolerance_below
175+
self.tolerance_above = abs(tolerance_above)
176+
self.tolerance_below = abs(tolerance_below)
178177

179178
def scale(self, scale_factor):
180179
self.value /= scale_factor

0 commit comments

Comments
 (0)