Skip to content

Commit

Permalink
Allow joint to recover after reaching position limits in servo mode (#…
Browse files Browse the repository at this point in the history
…1774)

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey authored Dec 13, 2023
1 parent 9f2d607 commit f82833d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dart/constraint/JointConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void JointConstraint::update()
// the position error.

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

Expand Down Expand Up @@ -280,7 +280,7 @@ void JointConstraint::update()
// the position error.

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

Expand Down

0 comments on commit f82833d

Please sign in to comment.