Skip to content

Commit f82833d

Browse files
authored
Allow joint to recover after reaching position limits in servo mode (#1774)
Signed-off-by: Addisu Z. Taddese <[email protected]>
1 parent 9f2d607 commit f82833d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dart/constraint/JointConstraint.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void JointConstraint::update()
238238
// the position error.
239239

240240
const double C1 = mErrorAllowance * A1;
241-
double bouncing_vel = -std::max(B1, C1) / timeStep;
241+
double bouncing_vel = -std::min(B1, C1) / timeStep;
242242
assert(bouncing_vel >= 0);
243243
bouncing_vel = std::min(bouncing_vel, mMaxErrorReductionVelocity);
244244

@@ -280,7 +280,7 @@ void JointConstraint::update()
280280
// the position error.
281281

282282
const double C2 = mErrorAllowance * A2;
283-
double bouncing_vel = -std::min(B2, C2) / timeStep;
283+
double bouncing_vel = -std::max(B2, C2) / timeStep;
284284
assert(bouncing_vel <= 0);
285285
bouncing_vel = std::max(bouncing_vel, -mMaxErrorReductionVelocity);
286286

0 commit comments

Comments
 (0)