Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

InvestigationCMCGait Class Reference

An abstract class for specifying the interface for an investigation. More...

#include <InvestigationCMCGait.h>

List of all members.

Public Member Functions

virtual ~InvestigationCMCGait ()
 Destructor.
 InvestigationCMCGait ()
 Default constructor.
 InvestigationCMCGait (const std::string &aFileName)
 Construct from an XML property file.
 InvestigationCMCGait (DOMElement *aElement)
 Construct from a DOMElement.
 InvestigationCMCGait (const InvestigationCMCGait &aObject)
 Copy constructor.
virtual OpenSim::Object * copy () const
 Virtual copy constructor.
virtual OpenSim::Object * copy (DOMElement *aElement) const
 Virtual copy constructor from DOMElement.
InvestigationCMCGaitoperator= (const InvestigationCMCGait &aInvestigationCMCGait)
 Assignment operator.
virtual void run ()
 Run the investigation.
OpenSim::ControlSet * constructRRAControlSet (OpenSim::ControlSet *aControlConstraints)
 Create a set of control constraints based on an RRA solution.
void setControlsToUseStepsExceptResiduals (const OpenSim::ControlSet *aRRAControlSet, OpenSim::ControlSet *ControlSet)
 Set controls to use steps except for the residuals, which use linear interpolation.
void initializeExternalLoads ()
 Initialize the external loads applied to the model.
void computeInitialStatesFromCoordinates (const OpenSim::FunctionSet &aQSet, OpenSim::Array< double > &rYI)
void computeAverageResiduals (OpenSim::Array< double > &rFAve, OpenSim::Array< double > &rMAve)
 Compute the average residuals.
void adjustCOMToReduceResiduals (const OpenSim::Array< double > &aFAve, const OpenSim::Array< double > &aMAve)
 Adjust the center of mass to reduce any DC offsets in MX and MZ.

Private Member Functions

void setNull ()
 Set all member variables to their null or default values.
void setupProperties ()
 Give this object's properties their XML names and add them to the property list held in class Object (.
void constructCorrectiveSprings ()

Private Attributes

OpenSim::PropertyStr _desiredKinematicsFileNameProp
 Name of the file containing the desired kinematic trajectories.
std::string & _desiredKinematicsFileName
OpenSim::PropertyStr _externalLoadsFileNameProp
 Name of the file containing the external loads applied to the model.
std::string & _externalLoadsFileName
OpenSim::PropertyStr _externalLoadsModelKinematicsFileNameProp
 Name of the file containing the model kinematics corresponding to the external loads.
std::string & _externalLoadsModelKinematicsFileName
OpenSim::PropertyStr _externalLoadsBody1Prop
 Name of the body to which the first set of external loads should be applied (e.g., the body name for the right foot).
std::string & _externalLoadsBody1
OpenSim::PropertyStr _externalLoadsBody2Prop
 Name of the body to which the second set of external loads should be applied (e.g., the body name for the left foot).
std::string & _externalLoadsBody2
OpenSim::PropertyStr _taskSetFileNameProp
 Name of the file containing the tracking tasks.
std::string & _taskSetFileName
OpenSim::PropertyStr _constraintsFileNameProp
 Name of the file containing the constraints on the controls.
std::string & _constraintsFileName
OpenSim::PropertyStr _rraControlsFileNameProp
 Name of the file containing the actuator controls output by rra.
std::string & _rraControlsFileName
OpenSim::PropertyDbl _lowpassCutoffFrequencyProp
 Low-pass cut-off frequency for filtering the desired kinematics.
double & _lowpassCutoffFrequency
OpenSim::PropertyDbl _lowpassCutoffFrequencyForLoadKinematicsProp
 Low-pass cut-off frequency for filtering the model kinematics corresponding to the external loads.
double & _lowpassCutoffFrequencyForLoadKinematics
OpenSim::PropertyDbl _targetDTProp
 Time window over which the desired actuator forces are achieved.
double & _targetDT
OpenSim::PropertyBool _useCurvatureFilterProp
 Flag indicating whether or not to use the curvature filter.
bool & _useCurvatureFilter
OpenSim::PropertyBool _useReflexesProp
 Set whether or not to use reflexes.
bool & _useReflexes
OpenSim::PropertyBool _useFastTargetProp
 Flag indicating whether to use the fast CMC optimization target.
bool & _useFastTarget
OpenSim::PropertyDbl _optimizerDXProp
 Perturbation size used by the optimizer to compute numerical derivatives.
double & _optimizerDX
OpenSim::PropertyDbl _convergenceCriterionProp
 Convergence criterion for the optimizer.
double & _convergenceCriterion
OpenSim::PropertyInt _maxIterationsProp
 Maximum number of iterations for the optimizer.
int & _maxIterations
OpenSim::PropertyInt _printLevelProp
 Print level for the optimizer, 0 - 3.
int & _printLevel
OpenSim::PropertyBool _includePipelineActuatorsProp
 Flag indicating whether or not to include SIMM Pipeline actuators.
bool & _includePipelineActuators
OpenSim::PropertyStr _adjustedCOMBodyProp
 Name of the body whose center of mass is adjusted.
std::string & _adjustedCOMBody
OpenSim::PropertyStr _adjustedCOMFileNameProp
 Name of the file specifying a change to the center of mass of a body.
std::string & _adjustedCOMFileName
OpenSim::PropertyBool _computeAverageResidualsProp
 Flag indicating whether or not to compute average residuals.
bool & _computeAverageResiduals
OpenSim::PropertyBool _adjustCOMToReduceResidualsProp
 Flag indicating whether or not to make an adjustment in the center of mass of a body to reduced DC offsets in MX and MZ.
bool & _adjustCOMToReduceResiduals


Detailed Description

An abstract class for specifying the interface for an investigation.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

InvestigationCMCGait::InvestigationCMCGait const std::string &  aFileName  ) 
 

Construct from an XML property file.

Parameters:
aFileName File name of the XML document.

InvestigationCMCGait::InvestigationCMCGait DOMElement *  aElement  ) 
 

Construct from a DOMElement.

DOM is an acronym for 'Document Object Model'. Once an XML file is read into memory, its content is contained in a DOM object. A CMC investigation can be constructed from one of these DOM elements.

Parameters:
aElement DOM element for the InvestigationCMCGait object.

InvestigationCMCGait::InvestigationCMCGait const InvestigationCMCGait aInvestigation  ) 
 

Copy constructor.

Copy constructors for all Investigations do not copy the Object's DOMnode and XMLDocument. The reason for this is that for the object and all its derived classes to establish the correct connection to the XML document nodes, the the object would need to reconstruct based on the XML document not the values of the object's member variables.

There are three proper ways to generate an XML document for an Investigation:

1) Construction based on XML file (

See also:
Investigation(const char *aFileName)). In this case, the XML document is created by parsing the XML file.
2) Construction by Investigation(const XMLDocument *aDocument). This constructor explictly requests construction based on an XML document that is held in memory. In this way the proper connection between an object's node and the corresponding node within the XML document is established. This constructor is a copy constructor of sorts because all essential Investigation member variables should be held within the XML document. The advantage of this style of construction is that nodes within the XML document, such as comments that may not have any associated Investigation member variable, are preserved.

3) A call to generateDocument(). This method generates an XML document for the Investigation from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).

Parameters:
aInvestigation Object to be copied.
See also:
Investigation(const XMLDocument *aDocument)

Investigation(const char *aFileName)

generateDocument()


Member Function Documentation

void InvestigationCMCGait::adjustCOMToReduceResiduals const OpenSim::Array< double > &  aFAve,
const OpenSim::Array< double > &  aMAve
 

Adjust the center of mass to reduce any DC offsets in MX and MZ.

Parameters:
aFAve The average residual forces. The dimension of aFAve should be 3.
aMAve The average residual moments. The dimension of aMAve should be 3.

void InvestigationCMCGait::computeAverageResiduals OpenSim::Array< double > &  rFAve,
OpenSim::Array< double > &  rMAve
 

Compute the average residuals.

Parameters:
rFAve The computed average force residuals. The size of rFAve is set to 3.
rMAve The computed average moment residuals. The size of rMAve is set to 3.

ControlSet * InvestigationCMCGait::constructRRAControlSet OpenSim::ControlSet *  aControlConstraints  ) 
 

Create a set of control constraints based on an RRA solution.

If RRA (Residual Reduction Algorithm) was run to compute or reduce the residuals as a preprocessing step, those residuals need to be applied during the CMC run. They are applied by reading in the residuals computed during RRA and then using these controls to place narrow constraints on the controls for the residual actuators active during the CMC run.

Parameters:
aControlConstraints Constraints based on a previous RRA solution to be used during this run of CMC.

Object * InvestigationCMCGait::copy DOMElement *  aElement  )  const [virtual]
 

Virtual copy constructor from DOMElement.

This is the method that is used to construct objects from an XML file. This constructor creates a copy of the object in all respects except that property values that are specified in the DOMElement are used to over-write the values in this object.

Returns:
Copy of this object with properties overriden by any properties specified in the DOMElement.

Object * InvestigationCMCGait::copy  )  const [virtual]
 

Virtual copy constructor.

Returns:
Copy of this object.

InvestigationCMCGait & InvestigationCMCGait::operator= const InvestigationCMCGait aInvestigation  ) 
 

Assignment operator.

Returns:
Reference to this object.

void InvestigationCMCGait::setControlsToUseStepsExceptResiduals const OpenSim::ControlSet *  aRRAControlSet,
OpenSim::ControlSet *  ControlSet
 

Set controls to use steps except for the residuals, which use linear interpolation.

This method also sets the min and max values for the controls.

Parameters:
aRRAControlSet Controls that were output by an RRA pass.
rControlSet Controls for the current run of CMC.

Todo:
The residuals are assumed to be the first 6 actuators. This needs to be made more general. And, the control bounds need to be set elsewhere, preferably in a file.

void InvestigationCMCGait::setupProperties  )  [private]
 

Give this object's properties their XML names and add them to the property list held in class Object (.

See also:
OpenSim::Object).


Member Data Documentation

OpenSim::PropertyStr InvestigationCMCGait::_adjustedCOMFileNameProp [private]
 

Name of the file specifying a change to the center of mass of a body.

This adjustment is made to remove dc offset in the residuals.

OpenSim::PropertyDbl InvestigationCMCGait::_lowpassCutoffFrequencyForLoadKinematicsProp [private]
 

Low-pass cut-off frequency for filtering the model kinematics corresponding to the external loads.

A negative value results in no filtering. The default value is -1.0, so no filtering.

OpenSim::PropertyDbl InvestigationCMCGait::_lowpassCutoffFrequencyProp [private]
 

Low-pass cut-off frequency for filtering the desired kinematics.

A negative value results in no filtering. The default value is -1.0, so no filtering.

OpenSim::PropertyInt InvestigationCMCGait::_printLevelProp [private]
 

Print level for the optimizer, 0 - 3.

0 = no printing, ..., 3 = detailed printing.

OpenSim::PropertyBool InvestigationCMCGait::_useFastTargetProp [private]
 

Flag indicating whether to use the fast CMC optimization target.

The fast target requires the desired accelerations to be met within the tolerance set by the convergence criterion. The optimizer fails if the acclerations constraints cannot be met, so the fast target is less robust. The regular target does not require the acceleration constraints to be met; it meets them as well as it can.


The documentation for this class was generated from the following files:
Generated on Wed Nov 1 16:04:32 2006 for Computed Muscle Control (CMC) API by doxygen 1.3.8