OpenSim  OpenSim 3.1
 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 ()
 This method sets all member variables to default (e.g., NULL) values.
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.
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.
TrackingControlleroperator= (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 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.
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

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

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 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: