A class implementing a collection of rolling-without-slipping and non-penetration constraints on a surface. More...
#include <RollingOnSurfaceConstraint.h>
Public Member Functions | |
RollingOnSurfaceConstraint () | |
Default constructor. | |
RollingOnSurfaceConstraint (const RollingOnSurfaceConstraint &aConstraint) | |
Copy constructor. | |
virtual | ~RollingOnSurfaceConstraint () |
Destructor. | |
virtual Object * | copy () const |
Copy this body and return a pointer to the copy. | |
RollingOnSurfaceConstraint & | operator= (const RollingOnSurfaceConstraint &aConstraint) |
Assignment operator. | |
void | copyData (const RollingOnSurfaceConstraint &aConstraint) |
Copy data members from one RollingOnSurfaceConstraint to another. | |
virtual void | setup (Model &aModel) |
Perform some setup functions that happen after the object has been deserialized or copied. | |
void | setRollingBodyByName (std::string aBodyName) |
Following methods set attributes of the weld constraint. | |
void | setSurfaceBodyByName (std::string aBodyName) |
void | setContactPointSurfaceBody (SimTK::Vec3 point) |
virtual std::vector< bool > | unilateralConditionsSatisfied (SimTK::State &state) |
virtual bool | getIsDisabled (const SimTK::State &state) const |
Get whether or not the RollingOnSurfaceConstraint is disabled. | |
virtual bool | setIsDisabled (SimTK::State &state, bool isDisabled) |
Set whether or not the RollingOnSurfaceConstraint is disabled. | |
bool | setIsDisabled (SimTK::State &state, bool isDisabled, std::vector< bool > shouldBeOn) |
bool | setIsDisabledWithCachedUnilateralConditions (bool isDisabled, SimTK::State &state) |
virtual void | calcConstraintForces (const SimTK::State &state, SimTK::Vector_< SimTK::SpatialVec > &bodyForcesInParent, SimTK::Vector &mobilityForces) |
Ask the RollingOnSurfaceConstraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities. | |
Protected Attributes | |
PropertyStr | _rollingBodyNameProp |
Specify the rolling body for this constraint. | |
std::string & | _rollingBodyName |
PropertyStr | _surfaceBodyNameProp |
Specify the body containing the surface (plane) that the rolling body rolls on. | |
std::string & | _surfaceBodyName |
PropertyDblVec3 | _surfaceNormalProp |
Surface normal direction in the surface body. | |
SimTK::Vec3 & | _surfaceNormal |
PropertyDbl | _surfaceHeightProp |
Surface height in the direction of the normal in the surface body. | |
double & | _surfaceHeight |
PropertyDbl | _coulombFrictionCoefficientProp |
Coulomb friction coefficient for rolling on the surface. | |
double & | _coulombFrictionCoefficient |
PropertyDbl | _surfaceContactRadiusProp |
A guess at the area of contact approximated by a circle of radius:. | |
double & | _surfaceContactRadius |
Body * | _rollingBody |
First body is the rolling body. | |
Body * | _surfaceBody |
Second body describes the surface body. | |
std::vector < SimTK::ConstraintIndex > | _indices |
Get the indices of underlying constraints to access from Simbody. | |
std::vector< bool > | _cachedUnilateralConditions |
This cache acts a temporary hold for the constraint conditions when time has not changed. | |
Friends | |
class | SimbodyEngine |
A class implementing a collection of rolling-without-slipping and non-penetration constraints on a surface.
The underlying Constraints in Simbody are: PointInPlane to oppose penetration into the ground (unitlaterally) ConstantAngle about the normal to the enforce no spinning NoSlip1D along one axis of the plane NoSlip1D along the other axis
mu = Coulomb Friction Coeefficient
Each of these constraints have condition dependent on the reaction forces generate collectively: PointInPlane normal force (Fn) must be positive (in the direction of the normal) ConstantAngle the reaction torque cannnot exceed contactRadius*mu*Fn Both NoSlip conditions are treated together, the magnitude the combined reaction forces (in the plane) cannot exceed mu*Fn
RollingOnSurfaceConstraint::RollingOnSurfaceConstraint | ( | ) |
Default constructor.
RollingOnSurfaceConstraint::RollingOnSurfaceConstraint | ( | const RollingOnSurfaceConstraint & | aConstraint | ) |
Copy constructor.
aConstraint | RollingOnSurfaceConstraint to be copied. |
RollingOnSurfaceConstraint::~RollingOnSurfaceConstraint | ( | ) | [virtual] |
Destructor.
void RollingOnSurfaceConstraint::calcConstraintForces | ( | const SimTK::State & | state, | |
SimTK::Vector_< SimTK::SpatialVec > & | bodyForcesInParent, | |||
SimTK::Vector & | mobilityForces | |||
) | [virtual] |
Ask the RollingOnSurfaceConstraint for the forces it is imposing on the system Simbody multibody system must be realized to at least position Returns: the bodyForces on those bodies being constrained (constrainedBodies) a SpatialVec (6 components) describing resulting torque and force mobilityForces acting along constrained mobilities.
state | State of model | |
bodyForcesInParent | is a Vector of SpatialVecs contain constraint forces | |
mobilityForces | is a Vector of forces that act along the constrained mobilitities associated with this constraint |
Reimplemented from OpenSim::Constraint.
Object * RollingOnSurfaceConstraint::copy | ( | ) | const [virtual] |
Copy this body and return a pointer to the copy.
The copy constructor for this class is used.
Reimplemented from OpenSim::UnilateralConstraint.
void RollingOnSurfaceConstraint::copyData | ( | const RollingOnSurfaceConstraint & | aConstraint | ) |
Copy data members from one RollingOnSurfaceConstraint to another.
aConstraint | RollingOnSurfaceConstraint to be copied. |
Reimplemented from OpenSim::UnilateralConstraint.
bool RollingOnSurfaceConstraint::getIsDisabled | ( | const SimTK::State & | state | ) | const [virtual] |
Get whether or not the RollingOnSurfaceConstraint is disabled.
Simbody multibody system instance is realized every time the isDisabled changes, BUT multiple sets to the same value have no cost.
isDisabled | If true the constraint is disabled; if false the constraint is enabled. |
Reimplemented from OpenSim::Constraint.
RollingOnSurfaceConstraint & RollingOnSurfaceConstraint::operator= | ( | const RollingOnSurfaceConstraint & | aConstraint | ) |
Assignment operator.
Reimplemented from OpenSim::UnilateralConstraint.
void OpenSim::RollingOnSurfaceConstraint::setContactPointSurfaceBody | ( | SimTK::Vec3 | point | ) |
bool RollingOnSurfaceConstraint::setIsDisabled | ( | SimTK::State & | state, | |
bool | isDisabled, | |||
std::vector< bool > | shouldBeOn | |||
) |
bool RollingOnSurfaceConstraint::setIsDisabled | ( | SimTK::State & | state, | |
bool | isDisabled | |||
) | [virtual] |
Set whether or not the RollingOnSurfaceConstraint is disabled.
Since the constraint is composed of multiple constraints, this method can diable the constraints, but enabling is not guaranteed. For example, if the unilateral conditions are violated the constraint will be disabled.
isDisabled | If true the constraint is disabled; if false the constraint is enabled. |
bool OpenSim::RollingOnSurfaceConstraint::setIsDisabledWithCachedUnilateralConditions | ( | bool | isDisabled, | |
SimTK::State & | state | |||
) | [inline] |
void RollingOnSurfaceConstraint::setRollingBodyByName | ( | std::string | aBodyName | ) |
Following methods set attributes of the weld constraint.
void RollingOnSurfaceConstraint::setSurfaceBodyByName | ( | std::string | aBodyName | ) |
void RollingOnSurfaceConstraint::setup | ( | Model & | aModel | ) | [virtual] |
Perform some setup functions that happen after the object has been deserialized or copied.
aEngine | dynamics engine containing this RollingOnSurfaceConstraint. |
Reimplemented from OpenSim::UnilateralConstraint.
std::vector< bool > RollingOnSurfaceConstraint::unilateralConditionsSatisfied | ( | SimTK::State & | state | ) | [virtual] |
friend class SimbodyEngine [friend] |
Reimplemented from OpenSim::UnilateralConstraint.
std::vector<bool> OpenSim::RollingOnSurfaceConstraint::_cachedUnilateralConditions [protected] |
This cache acts a temporary hold for the constraint conditions when time has not changed.
double& OpenSim::RollingOnSurfaceConstraint::_coulombFrictionCoefficient [protected] |
Coulomb friction coefficient for rolling on the surface.
std::vector<SimTK::ConstraintIndex> OpenSim::RollingOnSurfaceConstraint::_indices [protected] |
Get the indices of underlying constraints to access from Simbody.
Body* OpenSim::RollingOnSurfaceConstraint::_rollingBody [protected] |
First body is the rolling body.
std::string& OpenSim::RollingOnSurfaceConstraint::_rollingBodyName [protected] |
Specify the rolling body for this constraint.
Body* OpenSim::RollingOnSurfaceConstraint::_surfaceBody [protected] |
Second body describes the surface body.
std::string& OpenSim::RollingOnSurfaceConstraint::_surfaceBodyName [protected] |
Specify the body containing the surface (plane) that the rolling body rolls on.
double& OpenSim::RollingOnSurfaceConstraint::_surfaceContactRadius [protected] |
A guess at the area of contact approximated by a circle of radius:.
double& OpenSim::RollingOnSurfaceConstraint::_surfaceHeight [protected] |
Surface height in the direction of the normal in the surface body.
SimTK::Vec3& OpenSim::RollingOnSurfaceConstraint::_surfaceNormal [protected] |
Surface normal direction in the surface body.