Simbody
3.4 (development)
|
This constraint enforces continuous contact and non-slip rolling between a spherical surface fixed on one body and a half space (flat surface) fixed on another. More...
#include <Constraint.h>
Public Member Functions | |
BallRollingOnPlane (MobilizedBody &planeBody_P, const UnitVec3 &defaultPlaneNormal_P, Real defaultPlaneHeight, MobilizedBody &ballBody_B, const Vec3 &defaultBallCenter_B, Real defaultBallRadius) | |
Create a BallOnPlane constraint and define the default plane and ball geometry. | |
BallRollingOnPlane () | |
Default constructor creates an empty handle. | |
BallRollingOnPlane & | setPlaneDisplayHalfWidth (Real) |
Real | getPlaneDisplayHalfWidth () const |
BallRollingOnPlane & | setDefaultPlaneNormal (const UnitVec3 &) |
BallRollingOnPlane & | setDefaultPlaneHeight (Real) |
BallRollingOnPlane & | setDefaultBallCenter (const Vec3 &) |
BallRollingOnPlane & | setDefaultBallRadius (Real) |
MobilizedBodyIndex | getPlaneMobilizedBodyIndex () const |
MobilizedBodyIndex | getBallMobilizedBodyIndex () const |
const UnitVec3 & | getDefaultPlaneNormal () const |
Real | getDefaultPlaneHeight () const |
const Vec3 & | getDefaultBallCenter () const |
Real | getDefaultBallRadius () const |
const UnitVec3 & | getPlaneNormal (const State &) const |
Real | getPlaneHeight (const State &) const |
const Vec3 & | getBallCenter (const State &) const |
Real | getBallRadius (const State &) const |
Real | getPositionError (const State &) const |
Vec3 | getVelocityError (const State &) const |
Vec3 | getAccelerationError (const State &) const |
Vec3 | getMultipliers (const State &) const |
Real | getNormalForce (const State &) const |
Return the signed magnitude of the normal force applied by the plane to the ball at the contact point, in the direction of the plane normal; negative indicates sticking. | |
Vec2 | getFrictionForceOnBallInPlaneFrame (const State &) const |
Return the friction force vector being applied by the plane to the ball at the contact point, expressed in the plane frame. |
This constraint enforces continuous contact and non-slip rolling between a spherical surface fixed on one body and a half space (flat surface) fixed on another.
This requires one holonomic (position) constraint equation enforcing contact, and two nonholonomic (velocity) contraint equations enforcing the non-slip condition in the plane. Note that this is a bilateral constraint and will push or pull as necessary to keep the sphere in contact with the plane, and that rolling is enforced regardless of the amount of normal force begin generated. If you want to make this unilateral, you must handle switching it on and off separately; when this constraint is enabled it always enforces the contact and no-slip conditions.
We define the contact point on the ball to be the unique point CB on the sphere surface at which the radius vector is antiparallel to the plane's normal vector, that is, the point of the sphere directly below the sphere center if the plane's normal is considered the "up" direction. Then the contact point CP on the plane is defined to be the point on the plane that is directly below the center; that is, the intersection of the antiparallel radius vector and the halfspace surface. Note that in general CB != CP; the sphere contact point and plane contact point will be separated along the plane normal by a small distance, limited to the constraint tolerance after assembly. Now we define the contact point C=(CB+CP)/2, the point in space that is half way between the sphere's contact point and the plane's contact point. Equal and opposite forces are applied to the ball body B and the plane body P, at the station on each body that is coincident with C.
The holonomic constraint we enforce is that point C should be touching the plane. We enforce this with the condition that ~C_P*n_P = h, that is, given the contact point C measured and expressed in the plane body's frame, the height of that point in the direction of the plane normal should be the height of the plane.
The assembly condition is the same as the run-time constraint: the point of the sphere where the inward normal is the same as the halfspace normal must be brought into contact with the halfspace surface.
SimTK::Constraint::BallRollingOnPlane::BallRollingOnPlane | ( | MobilizedBody & | planeBody_P, |
const UnitVec3 & | defaultPlaneNormal_P, | ||
Real | defaultPlaneHeight, | ||
MobilizedBody & | ballBody_B, | ||
const Vec3 & | defaultBallCenter_B, | ||
Real | defaultBallRadius | ||
) |
Create a BallOnPlane constraint and define the default plane and ball geometry.
Default constructor creates an empty handle.
BallRollingOnPlane& SimTK::Constraint::BallRollingOnPlane::setDefaultPlaneNormal | ( | const UnitVec3 & | ) |
const UnitVec3& SimTK::Constraint::BallRollingOnPlane::getDefaultPlaneNormal | ( | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getDefaultPlaneHeight | ( | ) | const |
const Vec3& SimTK::Constraint::BallRollingOnPlane::getDefaultBallCenter | ( | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getDefaultBallRadius | ( | ) | const |
const UnitVec3& SimTK::Constraint::BallRollingOnPlane::getPlaneNormal | ( | const State & | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getPlaneHeight | ( | const State & | ) | const |
const Vec3& SimTK::Constraint::BallRollingOnPlane::getBallCenter | ( | const State & | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getBallRadius | ( | const State & | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getPositionError | ( | const State & | ) | const |
Vec3 SimTK::Constraint::BallRollingOnPlane::getVelocityError | ( | const State & | ) | const |
Vec3 SimTK::Constraint::BallRollingOnPlane::getAccelerationError | ( | const State & | ) | const |
Vec3 SimTK::Constraint::BallRollingOnPlane::getMultipliers | ( | const State & | ) | const |
Real SimTK::Constraint::BallRollingOnPlane::getNormalForce | ( | const State & | ) | const |
Return the signed magnitude of the normal force applied by the plane to the ball at the contact point, in the direction of the plane normal; negative indicates sticking.
Vec2 SimTK::Constraint::BallRollingOnPlane::getFrictionForceOnBallInPlaneFrame | ( | const State & | ) | const |
Return the friction force vector being applied by the plane to the ball at the contact point, expressed in the plane frame.