API
4.2
For C++ developers

A model kinematic constraint to be enforced in the optimal control problem. More...
Public Member Functions  
const MocoConstraintInfo &  getConstraintInfo () const 
void  setConstraintInfo (const MocoConstraintInfo &cInfo) 
SimTK::ConstraintIndex  getSimbodyConstraintIndex () const 
Get the SimTK::ConstraintIndex associated with this MocoKinematicConstraint. More...  
int  getNumPositionEquations () const 
Get the number of scalar constraint equations at each kinematic level. More...  
int  getNumVelocityEquations () const 
int  getNumAccelerationEquations () const 
std::vector< KinematicLevel >  getKinematicLevels () const 
Get a vector of enums specifying the kinematic level of each scalar constraint equation in the associated model constraint, as each equation may need to be treated differently in a solver (e.g. More...  
void  calcKinematicConstraintErrors (const Model &model, const SimTK::State &state, SimTK::Vector &errors) const 
Convenience method for calculating constraint errors given a SimTK::State object. More...  
Friends  
class  MocoProblemRep 
A model kinematic constraint to be enforced in the optimal control problem.
Objects of this class can only be instantiated by a MocoPhase, since information from each constraint in the model is required to ensure that the correct values are assigned to internal variables during construction.
void OpenSim::MocoKinematicConstraint::calcKinematicConstraintErrors  (  const Model &  model, 
const SimTK::State &  state,  
SimTK::Vector &  errors  
)  const 
Convenience method for calculating constraint errors given a SimTK::State object.
This may not be the most efficient solution for solvers, but could be useful for a quick implementation or for debugging model constraints causing issues in an optimal control problem.

inline 

inline 
Get a vector of enums specifying the kinematic level of each scalar constraint equation in the associated model constraint, as each equation may need to be treated differently in a solver (e.g.
don't add Lagrange multipliers for derivatives of position or velocity constraint equations when looping through all scalar constraint equations).

inline 

inline 
Get the number of scalar constraint equations at each kinematic level.
Note that the total number of scalar constraint equations enforced is NOT equal to the sum of each of these values – you must include the first and second derivatives of the position equations and the first derivatives of the velocity equations into that count as well (this value can be obtained by calling getNumEquations()).

inline 

inline 
Get the SimTK::ConstraintIndex associated with this MocoKinematicConstraint.
Note that a SimTK::ConstraintIndex is different from what is returned from MocoPathConstraint::getPathConstraintIndex(): the former is an index to a model constraint, whereas the latter is an index to the path constraint errors vector in a MocoProblem.

inline 
References OpenSim::MocoConstraintInfo::getNumEquations().

friend 