Simbody
3.5
|
(Experimental -- API will change -- use at your own risk) Define a sphere on each of two bodies. More...
Public Member Functions | |
SphereSphereContact (MobilizedBody &mobod_F, const Vec3 &defaultCenterOnF, Real defaultRadiusOnF, MobilizedBody &mobod_B, const Vec3 &defaultCenterOnB, Real defaultRadiusOnB, Real minCOR, Real mu_s, Real mu_d, Real mu_v) | |
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). | |
bool | hasFriction (const State &state) const override |
Returns true if there is a friction constraint associated with this contact constraint. | |
Vec2 | getSlipVelocity (const State &state) const override |
Real | calcEffectiveCOF (const State &state, Real defaultTransitionSpeed, Real slipSpeed) const override |
Returns the effective coefficient of friction mu for this contact, given a relative slip 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). | |
void | getFrictionMultiplierIndices (const State &s, MultiplierIndex &ix_x, MultiplierIndex &ix_y) const override |
If hasFriction(), this method returns the multipliers used for the x- and y-direction friction constraints. |
(Experimental -- API will change -- use at your own risk) Define a sphere on each of two bodies.
This constraint will prevent interpenetration of those spheres, and provide for frictional forces when they are in contact. The resulting contact is parameterized by a coefficient of restitution for impacts in the plane normal direction, and by coefficients of friction for frictional forces in the plane.
SimTK::SphereSphereContact::SphereSphereContact | ( | MobilizedBody & | mobod_F, |
const Vec3 & | defaultCenterOnF, | ||
Real | defaultRadiusOnF, | ||
MobilizedBody & | mobod_B, | ||
const Vec3 & | defaultCenterOnB, | ||
Real | defaultRadiusOnB, | ||
Real | minCOR, | ||
Real | mu_s, | ||
Real | mu_d, | ||
Real | mu_v | ||
) |
bool SimTK::SphereSphereContact::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::SphereSphereContact::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::SphereSphereContact::isEnabled | ( | const State & | state | ) | const [inline, override, virtual] |
Return true if this contact is enabled.
Implements SimTK::UnilateralContact.
Vec3 SimTK::SphereSphereContact::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::SphereSphereContact::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::SphereSphereContact::getVerr | ( | const State & | state | ) | const [inline, 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::SphereSphereContact::getAerr | ( | const State & | state | ) | const [inline, 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::SphereSphereContact::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.
bool SimTK::SphereSphereContact::hasFriction | ( | const State & | state | ) | const [inline, override, virtual] |
Returns true
if there is a friction constraint associated with this contact constraint.
If so, calcEffectiveCOF() must be overridden.
Reimplemented from SimTK::UnilateralContact.
Vec2 SimTK::SphereSphereContact::getSlipVelocity | ( | const State & | state | ) | const [inline, override, virtual] |
Reimplemented from SimTK::UnilateralContact.
Real SimTK::SphereSphereContact::calcEffectiveCOF | ( | const State & | state, |
Real | defaultTransitionSpeed, | ||
Real | slipSpeed | ||
) | const [inline, override, virtual] |
Returns the effective coefficient of friction mu for this contact, given a relative slip speed (a nonnegative scalar).
For a given pair of contacting materials this is typically a function of just the slip speed, but it could also depend on the time and configuration in state, which should be realized through Stage::Position. The given default slip-to-roll transition speed threshold (also nonnegative) is used to calculate mu unless this Contact overrides it with its own transition speed.
Reimplemented from SimTK::UnilateralContact.
MultiplierIndex SimTK::SphereSphereContact::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.
void SimTK::SphereSphereContact::getFrictionMultiplierIndices | ( | const State & | state, |
MultiplierIndex & | ix_x, | ||
MultiplierIndex & | ix_y | ||
) | const [override, virtual] |
If hasFriction(), this method returns the multipliers used for the x- and y-direction friction constraints.
If no friction, or if this constraint is disabled, the returned values are invalid.
Reimplemented from SimTK::UnilateralContact.