Simbody
3.5
|
(Experimental -- API will change -- use at your own risk) Set a hard limit on the maximum value of a generalized coordinate q. More...
Public Member Functions | |
HardStopUpper (MobilizedBody &mobod, MobilizerQIndex whichQ, Real defaultUpperLimit, Real minCOR) | |
bool | disable (State &state) const override |
Disable the normal and friction constraints if they were enabled. | |
bool | enable (State &state) const override |
Enable the normal and friction constraints if they were disabled. | |
bool | isEnabled (const State &state) const override |
Return true if this contact is enabled. | |
Vec3 | whereToDisplay (const State &state) const override |
This returns a point in the ground frame at which you might want to say the constraint is "located", for purposes of display only. | |
Real | getPerr (const State &state) const override |
Return the position error for the contact constraint (usually a signed distance function). | |
Real | getVerr (const State &state) const override |
Return the time derivative of the contact constraint position error. | |
Real | getAerr (const State &state) const override |
Return the time derivative of the contact constraint velocity error. | |
Real | calcEffectiveCOR (const State &state, Real defaultCaptureSpeed, Real defaultMinCORSpeed, Real impactSpeed) const override |
Returns the effective coefficient of restitution (COR) for this contact, given an impact speed (a nonnegative scalar). | |
MultiplierIndex | getContactMultiplierIndex (const State &s) const override |
Return the multiplier index Simbody assigned for the unilateral contact constraint (for contact, this is the normal constraint). |
(Experimental -- API will change -- use at your own risk) Set a hard limit on the maximum value of a generalized coordinate q.
A generalized force opposes further excursion of the coordinate, and a generalized impulse is produced when the stop is hit with a non-zero velocity (an impact). A coefficient of restitution (COR) e, with 0<=e<=1 is specified that determines the rebound impulse that occurs as a result of impact. The COR is typically velocity-dependent. The given value is the COR at high impact velocities; it will be higher for low impact velocities but zero at very small impact velocities.
The sign convention for this unilateral constraint is negative, meaning that perr,verr,aerr<=0, lambda>=0 are the good directions.
SimTK::HardStopUpper::HardStopUpper | ( | MobilizedBody & | mobod, |
MobilizerQIndex | whichQ, | ||
Real | defaultUpperLimit, | ||
Real | minCOR | ||
) |
bool SimTK::HardStopUpper::disable | ( | State & | state | ) | const [inline, override, virtual] |
Disable the normal and friction constraints if they were enabled.
Return true if we actually had to disable something.
Implements SimTK::UnilateralContact.
bool SimTK::HardStopUpper::enable | ( | State & | state | ) | const [inline, override, virtual] |
Enable the normal and friction constraints if they were disabled.
Return true if we actually had to enable something.
Implements SimTK::UnilateralContact.
bool SimTK::HardStopUpper::isEnabled | ( | const State & | state | ) | const [inline, override, virtual] |
Return true if this contact is enabled.
Implements SimTK::UnilateralContact.
Vec3 SimTK::HardStopUpper::whereToDisplay | ( | const State & | state | ) | const [override, virtual] |
This returns a point in the ground frame at which you might want to say the constraint is "located", for purposes of display only.
Implements SimTK::UnilateralContact.
Real SimTK::HardStopUpper::getPerr | ( | const State & | state | ) | const [override, virtual] |
Return the position error for the contact constraint (usually a signed distance function).
You have to apply the sign convention to interpret this properly.
Implements SimTK::UnilateralContact.
Real SimTK::HardStopUpper::getVerr | ( | const State & | state | ) | const [override, virtual] |
Return the time derivative of the contact constraint position error.
You have to apply the sign convention to interpret this properly.
Implements SimTK::UnilateralContact.
Real SimTK::HardStopUpper::getAerr | ( | const State & | state | ) | const [override, virtual] |
Return the time derivative of the contact constraint velocity error.
You have to apply the sign convention to interpret this properly.
Implements SimTK::UnilateralContact.
Real SimTK::HardStopUpper::calcEffectiveCOR | ( | const State & | state, |
Real | defaultCaptureSpeed, | ||
Real | defaultMinCORSpeed, | ||
Real | impactSpeed | ||
) | const [inline, override, virtual] |
Returns the effective coefficient of restitution (COR) for this contact, given an impact speed (a nonnegative scalar).
For a given pair of contacting materials this is typically a function of just the impact speed, but it could also depend on the time and configuration in state, which should be realized through Stage::Position. The given default impact speed thresholds (also nonnegative) are used to calculate the COR unless this Contact overrides those.
Implements SimTK::UnilateralContact.
MultiplierIndex SimTK::HardStopUpper::getContactMultiplierIndex | ( | const State & | state | ) | const [override, virtual] |
Return the multiplier index Simbody assigned for the unilateral contact constraint (for contact, this is the normal constraint).
If the constraint is not enabled, there is no multiplier and the returned index will be invalid.
Implements SimTK::UnilateralContact.