#include <Constraint.h>
Each built-in Constraint type is a local subclass within Constraint, and is also derived from Constraint.
Public Types | |
typedef Rod | ConstantDistance |
typedef Ball | CoincidentPoints |
typedef Weld | CoincidentFrames |
Public Member Functions | |
Constraint () | |
Constraint (ConstraintImpl *r) | |
void | disable (State &) const |
void | enable (State &) const |
bool | isDisabled (const State &) const |
bool | isDisabledByDefault () const |
void | setDisabledByDefault (bool shouldBeDisabled) |
Normally Constraints are enabled when defined and can be disabled later. | |
operator ConstraintIndex () const | |
ConstraintIndex | getConstraintIndex () const |
const SimbodyMatterSubsystem & | getMatterSubsystem () const |
SimbodyMatterSubsystem & | updMatterSubsystem () |
bool | isInSubsystem () const |
bool | isInSameSubsystem (const MobilizedBody &) const |
int | getNumConstrainedBodies () const |
Return the number of bodies *directly* restricted by this constraint. | |
const MobilizedBody & | getMobilizedBodyFromConstrainedBody (ConstrainedBodyIndex) const |
Return a reference to the actual MobilizedBodies included in the count above. | |
const MobilizedBody & | getAncestorMobilizedBody () const |
Return a reference to the actual MobilizedBody which is serving as the Ancestor body for the constrained bodies in this Constraint. | |
int | getNumConstrainedMobilizers () const |
Return the number of mobilizers *directly* restricted by this constraint. | |
const MobilizedBody & | getMobilizedBodyFromConstrainedMobilizer (ConstrainedMobilizerIndex) const |
Return a reference to the actual MobilizedBodies included in the count of constrained mobilizers above. | |
const SimbodyMatterSubtree & | getSubtree () const |
int | getNumConstrainedQ (const State &, ConstrainedMobilizerIndex) const |
Return the number of constrainable generalized coordinates q associated with a particular constrained mobilizer. | |
int | getNumConstrainedU (const State &, ConstrainedMobilizerIndex) const |
Return the number of constrainable mobilities u associated with a particular constrained mobilizer. | |
ConstrainedUIndex | getConstrainedUIndex (const State &, ConstrainedMobilizerIndex, MobilizerUIndex which) const |
Return the index into the constrained mobilities u array corresponding to a particular mobility of the indicated ConstrainedMobilizer. | |
ConstrainedQIndex | getConstrainedQIndex (const State &, ConstrainedMobilizerIndex, MobilizerQIndex which) const |
Return the index into the constrained coordinates q array corresponding to a particular coordinate of the indicated ConstrainedMobilizer. | |
int | getNumConstrainedQ (const State &) const |
Return the sum of the number of coordinates q associated with each of the constrained mobilizers. | |
int | getNumConstrainedU (const State &) const |
Return the sum of the number of mobilities u associated with each of the constrained mobilizers. | |
void | getNumConstraintEquationsInUse (const State &, int &mp, int &mv, int &ma) const |
Find out how many holonomic (position), nonholonomic (velocity), and acceleration-only constraint equations are generated by this Constraint. | |
Vector | getPositionErrorsAsVector (const State &) const |
Get a Vector containing the position errors. | |
Vector | calcPositionErrorFromQ (const State &, const Vector &q) const |
Matrix | calcPositionConstraintMatrixP (const State &) const |
Matrix | calcPositionConstraintMatrixPt (const State &) const |
Matrix | calcPositionConstraintMatrixPQInverse (const State &) const |
void | calcConstraintForcesFromMultipliers (const State &, const Vector &lambda, Vector_< SpatialVec > &bodyForcesInA, Vector &mobilityForces) const |
Vector | getVelocityErrorsAsVector (const State &) const |
Get a Vector containing the velocity errors. | |
Vector | calcVelocityErrorFromU (const State &, const Vector &u) const |
Matrix | calcVelocityConstraintMatrixV (const State &) const |
Matrix | calcVelocityConstraintMatrixVt (const State &) const |
Vector | getAccelerationErrorsAsVector (const State &) const |
Get a Vector containing the acceleration errors. | |
Vector | calcAccelerationErrorFromUDot (const State &, const Vector &udot) const |
Vector | getMultipliersAsVector (const State &) const |
Get a Vector containing the Lagrange multipliers. | |
Matrix | calcAccelerationConstraintMatrixA (const State &) const |
Matrix | calcAccelerationConstraintMatrixAt (const State &) const |
Classes | |
class | Ball |
Three constraint equations. More... | |
class | ConstantAngle |
One constraint equation. More... | |
class | ConstantOrientation |
Three constraint equations. More... | |
class | ConstantSpeed |
One non-holonomic constraint equation. More... | |
class | CoordinateCoupler |
This is a subclass of Constraint::Custom which uses a Function object to define a holonomic (position) constraint. More... | |
class | Custom |
The handle class Constraint::Custom (dataless) and its companion class Constraint::Custom::Implementation can be used together to define new Constraint types with arbitrary properties. More... | |
class | NoSlip1D |
One non-holonomic constraint equation. More... | |
class | PointInPlane |
One constraint equation. More... | |
class | PointOnLine |
Two constraint equations. More... | |
class | PrescribedMotion |
This is a subclass of Constraint::Custom which uses a Function to prescribe the behavior of a single generalized coordinate as a function of time. More... | |
class | Rod |
One constraint equation. More... | |
class | SpeedCoupler |
This is a subclass of Constraint::Custom which uses a Function object to define a nonholonomic (velocity) constraint. More... | |
class | Weld |
Six constraint equations. More... |
typedef Rod ConstantDistance |
typedef Ball CoincidentPoints |
typedef Weld CoincidentFrames |
Constraint | ( | ) | [inline] |
Constraint | ( | ConstraintImpl * | r | ) | [inline, explicit] |
void disable | ( | State & | ) | const |
void enable | ( | State & | ) | const |
bool isDisabled | ( | const State & | ) | const |
bool isDisabledByDefault | ( | ) | const |
void setDisabledByDefault | ( | bool | shouldBeDisabled | ) |
Normally Constraints are enabled when defined and can be disabled later.
If you want to define this constraint but have it be off by default, use this method.
operator ConstraintIndex | ( | ) | const [inline] |
ConstraintIndex getConstraintIndex | ( | ) | const |
const SimbodyMatterSubsystem& getMatterSubsystem | ( | ) | const |
SimbodyMatterSubsystem& updMatterSubsystem | ( | ) |
bool isInSubsystem | ( | ) | const |
bool isInSameSubsystem | ( | const MobilizedBody & | ) | const |
int getNumConstrainedBodies | ( | ) | const |
Return the number of bodies *directly* restricted by this constraint.
Included are any bodies to which the Constraint may apply a body force (i.e., torque or point force). The Ancestor body is not included unless it was specified as a ConstrainedBody. This is the length of the bodyForces array for this Constraint.
const MobilizedBody& getMobilizedBodyFromConstrainedBody | ( | ConstrainedBodyIndex | ) | const |
Return a reference to the actual MobilizedBodies included in the count above.
0 <= index < getNumConstrainedBodies().
const MobilizedBody& getAncestorMobilizedBody | ( | ) | const |
Return a reference to the actual MobilizedBody which is serving as the Ancestor body for the constrained bodies in this Constraint.
This will fail if there are no constrained bodies (i.e., if getNumConstrainedBodies()==0).
int getNumConstrainedMobilizers | ( | ) | const |
Return the number of mobilizers *directly* restricted by this constraint.
Included are any mobilizers to which the Constraint may apply any mobility force. Like bodies, mobilizers are referenced using the MobilizedBody containing them.
const MobilizedBody& getMobilizedBodyFromConstrainedMobilizer | ( | ConstrainedMobilizerIndex | ) | const |
Return a reference to the actual MobilizedBodies included in the count of constrained mobilizers above.
0 <= index < getNumConstrainedMobilizers().
const SimbodyMatterSubtree& getSubtree | ( | ) | const |
int getNumConstrainedQ | ( | const State & | , | |
ConstrainedMobilizerIndex | ||||
) | const |
Return the number of constrainable generalized coordinates q associated with a particular constrained mobilizer.
This is just the number of generalized coordinates for that mobilizer.
int getNumConstrainedU | ( | const State & | , | |
ConstrainedMobilizerIndex | ||||
) | const |
Return the number of constrainable mobilities u associated with a particular constrained mobilizer.
This is just the number of generalized speeds for that mobilizer.
ConstrainedUIndex getConstrainedUIndex | ( | const State & | , | |
ConstrainedMobilizerIndex | , | |||
MobilizerUIndex | which | |||
) | const |
Return the index into the constrained mobilities u array corresponding to a particular mobility of the indicated ConstrainedMobilizer.
Don't confuse this with the set of *participating* mobilities which also includes all mobilities on each branch between the ancestor and a constrained body. The *constrained* mobilities are just those belonging to the mobilizers which are directly constrained.
ConstrainedQIndex getConstrainedQIndex | ( | const State & | , | |
ConstrainedMobilizerIndex | , | |||
MobilizerQIndex | which | |||
) | const |
Return the index into the constrained coordinates q array corresponding to a particular coordinate of the indicated ConstrainedMobilizer.
Don't confuse this with the set of *participating* coordinates which also includes all coordinates on each branch between the ancestor and a constrained body. The *constrained* coordinates are just those belonging to the mobilizers which are directly constrained.
int getNumConstrainedQ | ( | const State & | ) | const |
Return the sum of the number of coordinates q associated with each of the constrained mobilizers.
int getNumConstrainedU | ( | const State & | ) | const |
Return the sum of the number of mobilities u associated with each of the constrained mobilizers.
These are the only mobilities to which the constraint may directly apply a force, so this is the dimension of the mobilityForces array.
void getNumConstraintEquationsInUse | ( | const State & | , | |
int & | mp, | |||
int & | mv, | |||
int & | ma | |||
) | const |
Find out how many holonomic (position), nonholonomic (velocity), and acceleration-only constraint equations are generated by this Constraint.
Get a Vector containing the position errors.
Many subclasses provide their own methods for getting this information in a more specific form.
void calcConstraintForcesFromMultipliers | ( | const State & | , | |
const Vector & | lambda, | |||
Vector_< SpatialVec > & | bodyForcesInA, | |||
Vector & | mobilityForces | |||
) | const |
Get a Vector containing the velocity errors.
Many subclasses provide their own methods for getting this information in a more specific form.
Get a Vector containing the acceleration errors.
Many subclasses provide their own methods for getting this information in a more specific form.
Get a Vector containing the Lagrange multipliers.
Many subclasses provide their own methods for getting this information in a more specific form.