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
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey committed Dec 13, 2023
1 parent 9f2d607 commit fe0fdca
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 fe0fdca

Please sign in to comment.