#include <rdCMC.h>
Public Member Functions | |
rdCMC (OpenSim::Model *aModel, rdCMC_TaskSet *aSet) | |
Contructor. | |
virtual | ~rdCMC () |
Destructor. | |
void | setNull () |
Set NULL values for all member variables. | |
void | setControlConstraints (OpenSim::ControlSet *aCcontrolSet) |
Set the control set that is used for placing constraints on the controls. | |
OpenSim::ControlSet * | getControlConstraints () |
Get the control set that is used for placing constraints on the controls. | |
OpenSim::ControlSet * | getControlSet () const |
Get the control set that the controller is using to control the simulation. | |
rdCMC_TaskSet * | getTaskSet () const |
Get the task set for this controller. | |
OpenSim::Array< int > * | getParameterList () |
Get the list of parameters in the control set that the controller is using to control the simulation. | |
OpenSim::rdFSQP * | getOptimizer () const |
Get the optimizer. | |
OpenSim::rdOptimizationTarget * | setOptimizationTarget (OpenSim::rdOptimizationTarget *aTarget) |
Set the optimization target for this controller. | |
OpenSim::rdOptimizationTarget * | getOptimizationTarget () const |
Get the optimization target for this controller. | |
void | setDT (double aDT) |
Set the requested integrator time step size. | |
double | getDT () const |
Get the requested integrator time step size. | |
void | setTargetTime (double aTime) |
Set the target time (or final time) for the controller. | |
double | getTargetTime () const |
Get the target time. | |
void | setTargetDT (double aDT) |
Set the target time step size. | |
double | getTargetDT () const |
Get the target time step size. | |
void | setCheckTargetTime (bool aTrueFalse) |
Set whether or not to check the target time. | |
bool | getCheckTargetTime () const |
Get whether or not to check the target time. | |
void | setActuatorForcePredictor (OpenSim::VectorFunctionForActuators *aPredictor) |
Set the predictor for actuator forces. | |
OpenSim::VectorFunctionForActuators * | getActuatorForcePredictor () |
Get the predictor for actuator forces. | |
OpenSim::Storage * | getPositionErrorStorage () const |
Get the storage object for position errors. | |
OpenSim::Storage * | getVelocityErrorStorage () const |
Get the storage object for velocity errors. | |
OpenSim::Storage * | getStressTermWeightStorage () const |
Get the storage object for stress term weights. | |
void | setUseCurvatureFilter (bool aTrueFalse) |
Set whether or not a curvature filter should be applied to the controls. | |
bool | getUseCurvatureFilter () const |
Get whether or not a curvature filter should be applied to the controls. | |
void | setUseReflexes (bool aTrueFalse) |
Set whether or not to use reflexes to constrain the controls. | |
bool | getUseReflexes () const |
Get whether or not to use reflexes to constrain the controls. | |
virtual void | constrainControlsBasedOnReflexes (double time, OpenSim::Array< double > &xmin, OpenSim::Array< double > &xmax) |
Constrain the controls based on reflexes. | |
void | restoreConfiguration (int nqnu, const double *yi, double *y) |
A utility method used to restore the coordinates and speeds to initial values. | |
void | obtainActuatorEquilibrium (double tiReal, double dtReal, OpenSim::Array< double > &x, OpenSim::Array< double > &y, bool hold) |
Obtain actuator equilibrium. | |
virtual void | computeInitialStates (double &rTI, double *rYI) |
Compute the initial states for a simulation. | |
virtual void | computeControls (double &rDT, double aT, const double *aY, OpenSim::ControlSet &rX) |
Compute the controls for a simulation. | |
Static Public Member Functions | |
void | FilterControls (const OpenSim::ControlSet &aControlSet, double aDT, double aT, OpenSim::Array< double > &rControls) |
Filter the controls. | |
Protected Attributes | |
OpenSim::rdFSQP * | _sqp |
Optimizer. | |
OpenSim::rdOptimizationTarget * | _target |
Optimization target for computing the controls. | |
rdCMC_TaskSet * | _taskSet |
Set of cmc tasks. | |
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. | |
OpenSim::Storage * | _pErrStore |
Storage object for the position errors. | |
OpenSim::Storage * | _vErrStore |
Storage object for the velocity errors. | |
OpenSim::Storage * | _stressTermWeightStore |
Storage object for the stress term weight. | |
OpenSim::ControlSet * | _controlSet |
Control set for the simulation. | |
OpenSim::ControlSet * | _controlConstraints |
Control set for constraining the values of the controls. | |
bool | _useCurvatureFilter |
Flag indicating whether or not a curvature filter should be applied to the controls. | |
bool | _useReflexes |
Flag indicating whether or not reflexes should be in effect. | |
OpenSim::ControlSet * | _controlConstraintsFromReflexes |
Control set for constraining the controls based on reflexes. | |
OpenSim::Array< int > | _paramList |
List of parameters in the control set that are serving as the controls in the optimization problem. | |
OpenSim::VectorFunctionForActuators * | _predictor |
Vector function for estimating actuator forces over a specified time interval. | |
OpenSim::Array< double > | _f |
Array of actuator forces for achieving the desired accelerations. |
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).
DG, Anderson FC (2006). Using computed muscle control to generate forward dynamic simulations of human walking from experimental data. J Biomech 39: 1107-15.
DG, Anderson FC, Delp SL (2003). Generating forward dynamic simulations of movement using computed muscle control. J Biomech 36: 321-8.
|
Contructor.
|
|
Compute the controls for a simulation. The caller should send in an initial guess.
|
|
Compute the initial states for a simulation. The caller should send in an initial guess. The Qs and Us are set based on the desired trajectories. The actuator states are set by sovling for a desired set of actuator forces, and then letting the states come to equilibrium for those forces.
|
|
Constrain the controls based on reflexes.
|
|
Filter the controls. This method was introduced as a means of attempting to reduce the sizes of residuals. Unfortunately, the approach was generally unsuccessful because the desired accelerations were not achieved.
|
|
Get whether or not to check the target time.
|
|
Get the control set that is used for placing constraints on the controls.
|
|
Get the control set that the controller is using to control the simulation.
|
|
Get the requested integrator time step size.
|
|
Get the optimization target for this controller.
|
|
Get the optimizer.
|
|
Get the list of parameters in the control set that the controller is using to control the simulation.
|
|
Get the storage object for position errors.
|
|
Get the storage object for stress term weights.
|
|
Get the target time step size. The target time step size is the step size used to compute a new target time, once the former target time has been reached by the integrator.
|
|
Get the target time. The target time is the time in the future for which the controls have been calculated. If an integrator is taking time steps prior to the target time, the controls should not have to be computed again.
|
|
Get the task set for this controller.
|
|
Get whether or not a curvature filter should be applied to the controls.
|
|
Get whether or not to use reflexes to constrain the controls.
|
|
Get the storage object for velocity errors.
|
|
Obtain actuator equilibrium. A series of long (e.g., 200 msec) integrations are performed to allow time-dependent actuators forces to reach equilibrium values.
|
|
A utility method used to restore the coordinates and speeds to initial values. The states associated with actuators are not changed.
|
|
Set whether or not to check the target time.
|
|
Set the control set that is used for placing constraints on the controls.
|
|
Set the requested integrator time step size.
|
|
Set the optimization target for this controller.
|
|
Set the target time step size. The target time step size is the step size used to compute a new target time, once the former target time has been reached by the integrator.
|
|
Set the target time (or final time) for the controller. The function of the controller is to compute a set of controls that are appropriate from the current time in a simulation to the target time of the controller. If an integrator is taking time steps prior to the target time, the controls should not have to be computed again.
|
|
Set whether or not a curvature filter should be applied to the controls.
|
|
Set whether or not to use reflexes to constrain the controls.
|
|
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. |
|
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. |