Simbody
3.7
|
Projected Gauss Seidel impulse solver. More...
Public Member Functions | |
PGSImpulseSolver (Real roll2slipTransitionSpeed) | |
bool | solve (int phase, const Array_< MultiplierIndex > &participating, const Matrix &A, const Vector &D, const Array_< MultiplierIndex > &expanding, Vector &piExpand, Vector &verrStart, Vector &verrApplied, Vector &pi, Array_< UncondRT > &unconditional, Array_< UniContactRT > &uniContact, Array_< UniSpeedRT > &uniSpeed, Array_< BoundedRT > &bounded, Array_< ConstraintLtdFrictionRT > &consLtdFriction, Array_< StateLtdFrictionRT > &stateLtdFriction) const override |
Solve with conditional constraints. More... | |
bool | solveBilateral (const Array_< MultiplierIndex > &participating, const Matrix &A, const Vector &D, const Vector &rhs, Vector &pi) const override |
Solve with only unconditional constraints. More... | |
Public Member Functions inherited from SimTK::ImpulseSolver | |
ImpulseSolver (Real roll2slipTransitionSpeed, Real convergenceTol, int maxIters) | |
virtual | ~ImpulseSolver () |
void | setMaxRollingSpeed (Real roll2slipTransitionSpeed) |
Real | getMaxRollingSpeed () const |
void | setConvergenceTol (Real tol) |
Real | getConvergenceTol () const |
void | setMaxIterations (int maxIts) |
int | getMaxIterations () const |
void | clearStats () const |
void | clearStats (int phase) const |
Additional Inherited Members | |
Public Types inherited from SimTK::ImpulseSolver | |
enum | ContactType { TypeNA =-1, Observing =0, Known =1, Participating =2 } |
enum | UniCond { UniNA =-1, UniOff =0, UniActive =1, UniKnown =2 } |
enum | FricCond { FricNA =-1, FricOff =0, Sliding =1, Impending =2, Rolling =3 } |
enum | BndCond { BndNA =-1, SlipLow =0, ImpendLow =1, Engaged =2, ImpendHigh =3, SlipHigh =4 } |
Static Public Member Functions inherited from SimTK::ImpulseSolver | |
static const char * | getContactTypeName (ContactType ct) |
static const char * | getUniCondName (UniCond uc) |
static const char * | getFricCondName (FricCond fc) |
static const char * | getBndCondName (BndCond bc) |
static void | dumpUniContacts (const String &msg, const Array_< UniContactRT > &uniContacts) |
Static Public Attributes inherited from SimTK::ImpulseSolver | |
static const int | MaxNumPhases = 3 |
Protected Attributes inherited from SimTK::ImpulseSolver | |
Real | m_maxRollingTangVel |
Real | m_convergenceTol |
int | m_maxIters |
long long | m_nSolves [MaxNumPhases] |
long long | m_nIters [MaxNumPhases] |
long long | m_nFail [MaxNumPhases] |
long long | m_nBilateralSolves |
long long | m_nBilateralIters |
long long | m_nBilateralFail |
Projected Gauss Seidel impulse solver.
Finds a solution to
[A+D] (piExpand+piUnknown) = v subject to piExpand <= 0 (given)
piUnknown_z <= 0 unilateral contact must push, not pull ||(piUnknown_x,piUnknown_y)|| <= -mu*pi_z unilateral friction cone where pi=piExpand+piUnknown.
piUnknown_speed <= 0 one-way ratchets lb <= piUnknown_bounded <= ub torque-limited motor
||piUnknown_F|| <= mu*||piUnknown_N|| friction in bilateral constraint ||piUnknown_F|| <= mu*N friction with known normal force N
When piUnknown_z[k] hits its upper limit of 0, we must have v_z[k] >= 0 (contact surfaces separating). We don't explicitly enforce that here; it depends on all diag(A)[z[k]] > 0. That means that if v_z[k]<0 we could improve the solution by making piUnknown_z[k] negative, so it wouldn't have hit the limit.
|
inlineexplicit |
|
overridevirtual |
Solve with conditional constraints.
In the common underdetermined case (redundant contact) we will return the first solution encountered but it is unlikely to be the best possible solution.
Implements SimTK::ImpulseSolver.
|
overridevirtual |
Solve with only unconditional constraints.
In the underdetermined case we return one of the possible solutions but it will not in general be the least squares one. In the overdetermined, inconsistent case we will iterate for a long time and may converge on the least-error solution but cannot guarantee that.
Implements SimTK::ImpulseSolver.