OpenSim  OpenSim 3.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
OpenSim::CMC Class Reference

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>

Inheritance diagram for OpenSim::CMC:
OpenSim::TrackingController OpenSim::Controller OpenSim::ModelComponent OpenSim::Object

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 ()
 
CMCoperator= (const CMC &aCmc)
 
void copyData (const CMC &aCmc)
 
Array< int > * getParameterList ()
 
SimTK::Optimizer * getOptimizer () const
 
OptimizationTargetsetOptimizationTarget (OptimizationTarget *aTarget, SimTK::Optimizer *aOptimizer)
 
OptimizationTargetgetOptimizationTarget () 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)
 
VectorFunctionForActuatorsgetActuatorForcePredictor ()
 
StoragegetPositionErrorStorage () const
 
StoragegetVelocityErrorStorage () const
 
StoragegetStressTermWeightStorage () const
 
bool getUseReflexes () const
 
void setUseVerbosePrinting (bool aTrueFalse)
 
bool getUseVerbosePrinting () const
 
void setUseCurvatureFilter (bool aTrueFalse)
 
bool getUseCurvatureFilter () const
 
const CMC_TaskSetgetTaskSet () const
 
CMC_TaskSetupdTaskSet () const
 
ControlSetupdControlSet ()
 
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. More...
 
virtual void computeInitialStates (SimTK::State &s, double &rTI)
 
virtual void computeControls (SimTK::State &s, ControlSet &rX)
 CMC algroithm. More...
 
virtual void setActuators (const Set< Actuator > &actuators)
 
virtual void setupProperties ()
 Connect properties to local pointers. More...
 
- Public Member Functions inherited from OpenSim::TrackingController
 TrackingController ()
 Default constructor. More...
 
 TrackingController (const TrackingController &TrackingController)
 Copy constructor. More...
 
virtual ~TrackingController ()
 Destructor. More...
 
TrackingControlleroperator= (const TrackingController &TrackingController)
 Assignment operator. More...
 
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. More...
 
virtual const StoragegetDesiredStatesStorage () 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. More...
 
bool isDisabled () const
 Get whether or not this controller is disabled. More...
 
void setDisabled (bool disableFlag)
 Disable this controller. More...
 
void setActuators (const Set< Actuator > &actuators)
 replace the current set of actuators with the provided set More...
 
void addActuator (const Actuator &actuator)
 add to the current set of actuators More...
 
const Set< Actuator > & getActuatorSet () const
 get a const reference to the current set of actuators More...
 
Set< Actuator > & updActuators ()
 get a writable reference to the set of actuators for this controller More...
 
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. More...
 
void addToSystem (SimTK::MultibodySystem &system) const override
 Model component interface that creates underlying computational components in the SimTK::MultibodySystem. More...
 
- Protected Member Functions inherited from OpenSim::TrackingController
void copyData (const TrackingController &aController)
 Copy the member variables of the specified controller. More...
 
- Protected Member Functions inherited from OpenSim::Controller
void setNumControls (int numControls)
 Only a Controller can set its number of controls based on its actuators. More...
 

Protected Attributes

SimTK::Optimizer * _optimizer
 Optimizer. More...
 
OptimizationTarget_target
 Optimization target for computing the controls. More...
 
double _dt
 Next integration step size that is to be taken by the integrator. More...
 
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. More...
 
bool _restoreDT
 Flag indicating when the last integration step size should be restored. More...
 
double _tf
 The target time is the time in the future (in normalized units) for which the controls have been calculated. More...
 
double _targetDT
 The step size used to generate a new target time, once the old target time has been reached. More...
 
bool _checkTargetTime
 Whether or not to check the target time. More...
 
Storage_pErrStore
 Storage object for the position errors. More...
 
Storage_vErrStore
 Storage object for the velocity errors. More...
 
Storage_stressTermWeightStore
 Storage object for the stress term weight. More...
 
ControlSet _controlSet
 
Array< int > _paramList
 List of parameters in the control set that are serving as the controls in the optimization problem. More...
 
bool _verbose
 Flag to indicate whether to use verbose printing. More...
 
bool _useCurvatureFilter
 
CMC_TaskSet_taskSet
 
VectorFunctionForActuators_predictor
 Vector function for estimating actuator forces over a specified time interval. More...
 
Array< double > _f
 Array of actuator forces for achieving the desired accelerations. More...
 
- Protected Attributes inherited from OpenSim::TrackingController
const Storage_desiredStatesStorage
 storage object containing the desired trajectory More...
 
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. More...
 
- Friends inherited from OpenSim::Controller

Detailed Description

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.

Author
Frank C. Anderson
Version
1.0

Constructor & Destructor Documentation

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 OpenSim::CMC::~CMC ( )
virtual

Member Function Documentation

void OpenSim::CMC::addToSystem ( SimTK::MultibodySystem &  system) const
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 void OpenSim::CMC::computeControls ( const SimTK::State &  s,
SimTK::Vector &  controls 
) const
virtual

Controller interface.

Implements OpenSim::TrackingController.

virtual void OpenSim::CMC::computeControls ( SimTK::State &  s,
ControlSet rX 
)
virtual

CMC algroithm.

virtual void OpenSim::CMC::computeInitialStates ( SimTK::State &  s,
double &  rTI 
)
virtual
void OpenSim::CMC::connectToModel ( Model model)
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 void OpenSim::CMC::FilterControls ( const SimTK::State &  s,
const ControlSet aControlSet,
double  aDT,
OpenSim::Array< double > &  rControls,
bool  aVerbosePrinting 
)
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 
)
CMC& OpenSim::CMC::operator= ( const CMC aCmc)
void OpenSim::CMC::restoreConfiguration ( SimTK::State &  s,
const SimTK::State &  initialState 
)
void OpenSim::CMC::setActuatorForcePredictor ( VectorFunctionForActuators aPredictor)
virtual void OpenSim::CMC::setActuators ( const Set< Actuator > &  actuators)
virtual
void OpenSim::CMC::setCheckTargetTime ( bool  aTrueFalse)
void OpenSim::CMC::setDT ( double  aDT)
void OpenSim::CMC::setNull ( )
OptimizationTarget* OpenSim::CMC::setOptimizationTarget ( OptimizationTarget aTarget,
SimTK::Optimizer *  aOptimizer 
)
void OpenSim::CMC::setTargetDT ( double  aDT)
void OpenSim::CMC::setTargetTime ( double  aTime)
virtual void OpenSim::CMC::setupProperties ( )
virtual

Connect properties to local pointers.

Reimplemented from OpenSim::TrackingController.

void OpenSim::CMC::setUseCurvatureFilter ( bool  aTrueFalse)
void OpenSim::CMC::setUseVerbosePrinting ( bool  aTrueFalse)
ControlSet& OpenSim::CMC::updControlSet ( )
inline
CMC_TaskSet& OpenSim::CMC::updTaskSet ( ) const

Member Data Documentation

bool OpenSim::CMC::_checkTargetTime
protected

Whether or not to check the target time.

ControlSet OpenSim::CMC::_controlSet
protected
double OpenSim::CMC::_dt
protected

Next integration step size that is to be taken by the integrator.

Array<double> OpenSim::CMC::_f
protected

Array of actuator forces for achieving the desired accelerations.

double OpenSim::CMC::_lastDT
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.

SimTK::Optimizer* OpenSim::CMC::_optimizer
protected

Optimizer.

Array<int> OpenSim::CMC::_paramList
protected

List of parameters in the control set that are serving as the controls in the optimization problem.

Storage* OpenSim::CMC::_pErrStore
protected

Storage object for the position errors.

VectorFunctionForActuators* OpenSim::CMC::_predictor
protected

Vector function for estimating actuator forces over a specified time interval.

bool OpenSim::CMC::_restoreDT
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.

Storage* OpenSim::CMC::_stressTermWeightStore
protected

Storage object for the stress term weight.

OptimizationTarget* OpenSim::CMC::_target
protected

Optimization target for computing the controls.

double OpenSim::CMC::_targetDT
protected

The step size used to generate a new target time, once the old target time has been reached.

CMC_TaskSet* OpenSim::CMC::_taskSet
protected
double OpenSim::CMC::_tf
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.

bool OpenSim::CMC::_useCurvatureFilter
protected
bool OpenSim::CMC::_verbose
protected

Flag to indicate whether to use verbose printing.

Storage* OpenSim::CMC::_vErrStore
protected

Storage object for the velocity errors.


The documentation for this class was generated from the following file: