OpenSim
OpenSim 3.1
|
Computed Muscle Control (CMC) is an optimization-based control technique designed specifically for controlling dynamic models that are actuated by redundant sets of actuators whose force-generating properties may be nonlinear and goverened by differential equaitions (as so have delays in force production). More...
#include <CMC.h>
Public Member Functions | |
CMC () | |
CMC (Model *aModel, CMC_TaskSet *aTaskSet) | |
CMC (const CMC &aCmc) | |
CMC (const std::string &aFileName, bool aUpdateFromXMLNode=true) | |
virtual | ~CMC () |
void | setNull () |
This method sets all member variables to default (e.g., NULL) values. | |
CMC & | operator= (const CMC &aCmc) |
void | copyData (const CMC &aCmc) |
Array< int > * | getParameterList () |
SimTK::Optimizer * | getOptimizer () const |
OptimizationTarget * | setOptimizationTarget (OptimizationTarget *aTarget, SimTK::Optimizer *aOptimizer) |
OptimizationTarget * | getOptimizationTarget () const |
void | setDT (double aDT) |
double | getDT () const |
void | setTargetTime (double aTime) |
double | getTargetTime () const |
void | setTargetDT (double aDT) |
double | getTargetDT () const |
void | setCheckTargetTime (bool aTrueFalse) |
bool | getCheckTargetTime () const |
void | setActuatorForcePredictor (VectorFunctionForActuators *aPredictor) |
VectorFunctionForActuators * | getActuatorForcePredictor () |
Storage * | getPositionErrorStorage () const |
Storage * | getVelocityErrorStorage () const |
Storage * | getStressTermWeightStorage () const |
bool | getUseReflexes () const |
void | setUseVerbosePrinting (bool aTrueFalse) |
bool | getUseVerbosePrinting () const |
void | setUseCurvatureFilter (bool aTrueFalse) |
bool | getUseCurvatureFilter () const |
const CMC_TaskSet & | getTaskSet () const |
CMC_TaskSet & | updTaskSet () const |
ControlSet & | updControlSet () |
void | restoreConfiguration (SimTK::State &s, const SimTK::State &initialState) |
void | obtainActuatorEquilibrium (SimTK::State &s, double tiReal, double dtReal, const Array< double > &x, bool hold) |
virtual void | computeControls (const SimTK::State &s, SimTK::Vector &controls) const |
Controller interface. | |
virtual void | computeInitialStates (SimTK::State &s, double &rTI) |
virtual void | computeControls (SimTK::State &s, ControlSet &rX) |
CMC algroithm. | |
virtual void | setActuators (const Set< Actuator > &actuators) |
replace the current set of actuators with the provided set | |
virtual void | setupProperties () |
Connect properties to local pointers. | |
Public Member Functions inherited from OpenSim::TrackingController | |
TrackingController () | |
Default constructor. | |
TrackingController (const TrackingController &TrackingController) | |
Copy constructor. | |
virtual | ~TrackingController () |
Destructor. | |
TrackingController & | operator= (const TrackingController &TrackingController) |
Assignment operator. | |
virtual void | setDesiredStatesStorage (const Storage *aYDesStore) |
Set this class's pointer to the storage object containing desired model states to point to the storage object passed into this method. | |
virtual const Storage & | getDesiredStatesStorage () const |
Public Member Functions inherited from OpenSim::Controller | |
OpenSim_DECLARE_PROPERTY (isDisabled, bool,"Flag (true or false) indicating whether or not the controller is disabled.") | |
OpenSim_DECLARE_LIST_PROPERTY (actuator_list, std::string,"The list of model actuators that this controller will control.""The keyword ALL indicates the controller will controll all the acuators in the model") | |
Controller () | |
Default constructor. | |
bool | isDisabled () const |
Get whether or not this controller is disabled. | |
void | setDisabled (bool disableFlag) |
Disable this controller. | |
void | addActuator (const Actuator &actuator) |
add to the current set of actuators | |
const Set< Actuator > & | getActuatorSet () const |
get a const reference to the current set of actuators | |
Set< Actuator > & | updActuators () |
get a writable reference to the set of actuators for this controller | |
int | getNumControls () const |
Static Public Member Functions | |
static void | FilterControls (const SimTK::State &s, const ControlSet &aControlSet, double aDT, OpenSim::Array< double > &rControls, bool aVerbosePrinting) |
Protected Member Functions | |
void | connectToModel (Model &model) override |
Model component interface that permits the controller to be "wired" up to its actuators. | |
void | addToSystem (SimTK::MultibodySystem &system) const override |
Model component interface that creates underlying computational components in the SimTK::MultibodySystem. | |
Protected Member Functions inherited from OpenSim::TrackingController | |
void | copyData (const TrackingController &aController) |
Copy the member variables of the specified controller. | |
Protected Member Functions inherited from OpenSim::Controller | |
void | setNumControls (int numControls) |
Only a Controller can set its number of controls based on its actuators. |
Protected Attributes | |
SimTK::Optimizer * | _optimizer |
Optimizer. | |
OptimizationTarget * | _target |
Optimization target for computing the controls. | |
double | _dt |
Next integration step size that is to be taken by the integrator. | |
double | _lastDT |
Last integration step size that was taken before a new integration step size was set in order to step exactly to the target time. | |
bool | _restoreDT |
Flag indicating when the last integration step size should be restored. | |
double | _tf |
The target time is the time in the future (in normalized units) for which the controls have been calculated. | |
double | _targetDT |
The step size used to generate a new target time, once the old target time has been reached. | |
bool | _checkTargetTime |
Whether or not to check the target time. | |
Storage * | _pErrStore |
Storage object for the position errors. | |
Storage * | _vErrStore |
Storage object for the velocity errors. | |
Storage * | _stressTermWeightStore |
Storage object for the stress term weight. | |
ControlSet | _controlSet |
Array< int > | _paramList |
List of parameters in the control set that are serving as the controls in the optimization problem. | |
bool | _verbose |
Flag to indicate whether to use verbose printing. | |
bool | _useCurvatureFilter |
CMC_TaskSet * | _taskSet |
VectorFunctionForActuators * | _predictor |
Vector function for estimating actuator forces over a specified time interval. | |
Array< double > | _f |
Array of actuator forces for achieving the desired accelerations. | |
Protected Attributes inherited from OpenSim::TrackingController | |
const Storage * | _desiredStatesStorage |
storage object containing the desired trajectory | |
Array< double > * | _trackingTasks |
Additional Inherited Members | |
Static Public Attributes inherited from OpenSim::Object | |
static const std::string | DEFAULT_NAME |
Name used for default objects when they are serialized. | |
Friends inherited from OpenSim::Controller | |
Related Functions inherited from OpenSim::Object | |
#define | OpenSim_DECLARE_CONCRETE_OBJECT(ConcreteClass, SuperClass) |
Macro to be included as the first line of the class declaration for any non-templatized, concrete class that derives from OpenSim::Object. | |
#define | OpenSim_DECLARE_ABSTRACT_OBJECT(ConcreteClass, SuperClass) |
Macro to be included as the first line of the class declaration for any still-abstract class that derives from OpenSim::Object. | |
#define | OpenSim_DECLARE_CONCRETE_OBJECT_T(ConcreteClass, TArg, SuperClass) |
Macro to be included as the first line of the class declaration for any templatized, concrete class that derives from OpenSim::Object, like Set<T>. | |
#define | OpenSim_DECLARE_ABSTRACT_OBJECT_T(ConcreteClass, TArg, SuperClass) |
Macro to be included as the first line of the class declaration for any templatized, still-abstract class that derives from OpenSim::Object. |
Computed Muscle Control (CMC) is an optimization-based control technique designed specifically for controlling dynamic models that are actuated by redundant sets of actuators whose force-generating properties may be nonlinear and goverened by differential equaitions (as so have delays in force production).
The cannonical example of such a dynamic system is the musculoskeletal system (human or animal), hence the name Computed Muscle Control.
For a complete description of the CMC algorithm consult the following references:
Anderson FC (2004). Method and system for dynamically filtering the motion of articulated bodies. Realistic Dynamics, Inc., US Patent No. 6,750,866 (Issue date: June 15, 2004).
Thelen DG, Anderson FC (2006). Using computed muscle control to generate forward dynamic simulations of human walking from experimental data. J Biomech 39: 1107-15.
Thelen DG, Anderson FC, Delp SL (2003). Generating forward dynamic simulations of movement using computed muscle control. J Biomech 36: 321-8.
OpenSim::CMC::CMC | ( | ) |
OpenSim::CMC::CMC | ( | Model * | aModel, |
CMC_TaskSet * | aTaskSet | ||
) |
OpenSim::CMC::CMC | ( | const CMC & | aCmc | ) |
OpenSim::CMC::CMC | ( | const std::string & | aFileName, |
bool | aUpdateFromXMLNode = true |
||
) |
|
virtual |
|
overrideprotectedvirtual |
Model component interface that creates underlying computational components in the SimTK::MultibodySystem.
This includes adding states, creating measures, etc... required by the controller.
Reimplemented from OpenSim::Controller.
|
virtual |
Controller interface.
Implements OpenSim::TrackingController.
|
virtual |
CMC algroithm.
|
virtual |
|
overrideprotectedvirtual |
Model component interface that permits the controller to be "wired" up to its actuators.
Subclasses can override to perform additional setup.
Reimplemented from OpenSim::Controller.
void OpenSim::CMC::copyData | ( | const CMC & | aCmc | ) |
|
static |
VectorFunctionForActuators* OpenSim::CMC::getActuatorForcePredictor | ( | ) |
bool OpenSim::CMC::getCheckTargetTime | ( | ) | const |
double OpenSim::CMC::getDT | ( | ) | const |
OptimizationTarget* OpenSim::CMC::getOptimizationTarget | ( | ) | const |
SimTK::Optimizer* OpenSim::CMC::getOptimizer | ( | ) | const |
Array<int>* OpenSim::CMC::getParameterList | ( | ) |
Storage* OpenSim::CMC::getPositionErrorStorage | ( | ) | const |
Storage* OpenSim::CMC::getStressTermWeightStorage | ( | ) | const |
double OpenSim::CMC::getTargetDT | ( | ) | const |
double OpenSim::CMC::getTargetTime | ( | ) | const |
const CMC_TaskSet& OpenSim::CMC::getTaskSet | ( | ) | const |
bool OpenSim::CMC::getUseCurvatureFilter | ( | ) | const |
bool OpenSim::CMC::getUseReflexes | ( | ) | const |
bool OpenSim::CMC::getUseVerbosePrinting | ( | ) | const |
Storage* OpenSim::CMC::getVelocityErrorStorage | ( | ) | const |
void OpenSim::CMC::obtainActuatorEquilibrium | ( | SimTK::State & | s, |
double | tiReal, | ||
double | dtReal, | ||
const Array< double > & | x, | ||
bool | hold | ||
) |
void OpenSim::CMC::restoreConfiguration | ( | SimTK::State & | s, |
const SimTK::State & | initialState | ||
) |
void OpenSim::CMC::setActuatorForcePredictor | ( | VectorFunctionForActuators * | aPredictor | ) |
replace the current set of actuators with the provided set
Reimplemented from OpenSim::Controller.
void OpenSim::CMC::setCheckTargetTime | ( | bool | aTrueFalse | ) |
void OpenSim::CMC::setDT | ( | double | aDT | ) |
void OpenSim::CMC::setNull | ( | ) |
This method sets all member variables to default (e.g., NULL) values.
Reimplemented from OpenSim::TrackingController.
OptimizationTarget* OpenSim::CMC::setOptimizationTarget | ( | OptimizationTarget * | aTarget, |
SimTK::Optimizer * | aOptimizer | ||
) |
void OpenSim::CMC::setTargetDT | ( | double | aDT | ) |
void OpenSim::CMC::setTargetTime | ( | double | aTime | ) |
|
virtual |
Connect properties to local pointers.
Reimplemented from OpenSim::TrackingController.
void OpenSim::CMC::setUseCurvatureFilter | ( | bool | aTrueFalse | ) |
void OpenSim::CMC::setUseVerbosePrinting | ( | bool | aTrueFalse | ) |
|
inline |
CMC_TaskSet& OpenSim::CMC::updTaskSet | ( | ) | const |
|
protected |
Whether or not to check the target time.
|
protected |
|
protected |
Next integration step size that is to be taken by the integrator.
|
protected |
Array of actuator forces for achieving the desired accelerations.
|
protected |
Last integration step size that was taken before a new integration step size was set in order to step exactly to the target time.
|
protected |
Optimizer.
|
protected |
List of parameters in the control set that are serving as the controls in the optimization problem.
|
protected |
Vector function for estimating actuator forces over a specified time interval.
|
protected |
Flag indicating when the last integration step size should be restored.
Normally it is restored only following a change to the integration step size that was made to step exactly to the end of a target interval.
|
protected |
Optimization target for computing the controls.
|
protected |
The step size used to generate a new target time, once the old target time has been reached.
|
protected |
|
protected |
The target time is the time in the future (in normalized units) for which the controls have been calculated.
If an integrator is taking steps prior to the target time, the controls should not have to be computed again.
|
protected |
|
protected |
Flag to indicate whether to use verbose printing.