OpenSim Moco
0.4.0
|
A path constraint to be enforced in the optimal control problem.
The use of 'path' here is unrelated to muscle paths, GeometryPath, or file system paths (e.g., Path).
#include <Moco/Moco/MocoConstraint.h>
Public Member Functions | |
const MocoConstraintInfo & | getConstraintInfo () const |
MocoConstraintInfo & | updConstraintInfo () |
void | setConstraintInfo (const MocoConstraintInfo &cInfo) |
int | getPathConstraintIndex () const |
For use by solvers. More... | |
void | calcPathConstraintErrors (const SimTK::State &state, SimTK::Vector &errors) const |
Calculate errors in the path constraint equations. More... | |
void | initializeOnModel (const Model &model, const MocoProblemInfo &, const int &pathConstraintIndex) const |
For use by solvers. This also performs error checks on the Problem. | |
Protected Member Functions | |
OpenSim_DECLARE_UNNAMED_PROPERTY (MocoConstraintInfo, "The bounds and " "labels for this MocoPathConstraint.") | |
virtual void | initializeOnModelImpl (const Model &, const MocoProblemInfo &) const =0 |
Perform any caching. More... | |
void | setNumEquations (int numEqs) const |
Set the number of scalar equations for this MocoPathConstraint. More... | |
virtual void | calcPathConstraintErrorsImpl (const SimTK::State &state, SimTK::Vector &errors) const =0 |
const Model & | getModel () const |
For use within virtual function implementations. | |
|
inline |
Calculate errors in the path constraint equations.
The errors argument represents the concatenated error vector for all path constraints in the MocoProblem. This method creates a view into errors to access the elements for this MocoPathConstraint and passes this view to calcPathConstraintErrorsImpl().
|
protectedpure virtual |
Implemented in OpenSim::MocoFrameDistanceConstraint, and OpenSim::MocoControlBoundConstraint.
|
inline |
For use by solvers.
This index is the location of this MocoPathConstraint's first error in the MocoProblem's full path constraint errors vector. Since it is set by the MocoProblem, it is only available after initialization.
|
protectedpure virtual |
Perform any caching.
The number of scalar constraint equations this MocoPathConstraint implements must be defined here (see setNumEquations() below).
Implemented in OpenSim::MocoFrameDistanceConstraint, and OpenSim::MocoControlBoundConstraint.
|
inlineprotected |
Set the number of scalar equations for this MocoPathConstraint.
This must be set within initializeImpl(), otherwise an exception is thrown during initialization.