An abstract class for specifying the interface for an investigation. More...
#include <CMCTool.h>
Public Member Functions | |
virtual | ~CMCTool () |
Destructor. | |
CMCTool () | |
Default constructor. | |
CMCTool (const std::string &aFileName, bool aLoadModel=true) SWIG_DECLARE_EXCEPTION | |
CMCTool (const CMCTool &aObject) | |
Copy constructor. | |
virtual Object * | copy () const |
Virtual copy constructor. | |
CMCTool & | operator= (const CMCTool &aCMCTool) |
Assignment operator. | |
const std::string & | getDesiredPointsFileName () |
void | setDesiredPointsFileName (const std::string &aFileName) |
const std::string & | getDesiredKinematicsFileName () |
void | setDesiredKinematicsFileName (const std::string &aFileName) |
const std::string & | getConstraintsFileName () |
void | setConstraintsFileName (const std::string &aFileName) |
const std::string & | getTaskSetFileName () |
void | setTaskSetFileName (const std::string &aFileName) |
const std::string & | getRRAControlsFileName () |
void | setRRAControlsFileName (const std::string &aFileName) |
const std::string & | getOutputModelFileName () |
void | setOutputModelFileName (const std::string &aFileName) |
bool | getAdjustCOMToReduceResiduals () |
void | setAdjustCOMToReduceResiduals (bool aAdjust) |
const std::string & | getAdjustedCOMBody () |
void | setAdjustedCOMBody (const std::string &aBody) |
bool | getAdjustKinematicsToReduceResiduals () |
void | setAdjustKinematicsToReduceResiduals (bool aAdjust) |
double | getLowpassCutoffFrequency () const |
void | setLowpassCutoffFrequency (double aLowpassCutoffFrequency) |
double | getTimeWindow () const |
void | setTimeWindow (double aTargetDT) |
const std::string & | getExternalLoadsFileName () const |
void | setExternalLoadsFileName (const std::string &aFileName) |
const std::string & | getExternalLoadsModelKinematicsFileName () const |
void | setExternalLoadsModelKinematicsFileName (const std::string &aFileName) |
const std::string & | getExternalLoadsBody1 () const |
void | setExternalLoadsBody1 (const std::string &aName) |
const std::string & | getExternalLoadsBody2 () const |
void | setExternalLoadsBody2 (const std::string &aName) |
double | getLowpassCutoffFrequencyForLoadKinematics () const |
void | setLowpassCutoffFrequencyForLoadKinematics (double aLowpassCutoffFrequency) |
bool | getUseFastTarget () const |
void | setUseFastTarget (bool useFastTarget) const |
virtual bool | run () SWIG_DECLARE_EXCEPTION |
Run the investigation. | |
Storage & | getForceStorage () |
Get a pointer to the Storage object holding forces. | |
void | setOriginalForceSet (const ForceSet &aForceSet) |
ControlSet * | constructRRAControlSet (ControlSet *aControlConstraints) |
Create a set of control constraints based on an RRA solution. | |
void | initializeControlSetUsingConstraints (const ControlSet *aRRAControlSet, const ControlSet *aControlConstraints, ControlSet &rControlSet) |
Set controls to use steps except for the residuals, which use linear interpolation. | |
void | adjustCOMToReduceResiduals (SimTK::State &s, const Storage &qStore, const Storage &uStore) |
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. | |
void | addNecessaryAnalyses () |
Add Actuation/Kinematics analyses if necessary. | |
void | writeAdjustedModel () |
Static Public Member Functions | |
static void | computeAverageResiduals (const Storage &aForceStore, OpenSim::Array< double > &rFAve, OpenSim::Array< double > &rMAve) |
Compute the average residuals. | |
static void | computeAverageResiduals (SimTK::State &s, Model &aModel, double aTi, double aTf, const Storage &aStatesStore, OpenSim::Array< double > &rFAve, OpenSim::Array< double > &rMAve) |
An abstract class for specifying the interface for an investigation.
CMCTool::~CMCTool | ( | ) | [virtual] |
Destructor.
CMCTool::CMCTool | ( | ) |
Default constructor.
OpenSim::CMCTool::CMCTool | ( | const std::string & | aFileName, | |
bool | aLoadModel = true | |||
) |
CMCTool::CMCTool | ( | const CMCTool & | aTool | ) |
Copy constructor.
Copy constructors for all Tools 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 a Tool:
1) Construction based on XML file (
2) Construction by Tool(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 Tool 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 Tool member variable, are preserved.
3) A call to generateXMLDocument(). This method generates an XML document for the Tool from scratch. Only the essential document nodes are created (that is, nodes that correspond directly to member variables.).
aTool | Object to be copied. |
void CMCTool::addNecessaryAnalyses | ( | ) |
Add Actuation/Kinematics analyses if necessary.
void CMCTool::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.
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 CMCTool::adjustCOMToReduceResiduals | ( | SimTK::State & | s, | |
const Storage & | qStore, | |||
const Storage & | uStore | |||
) |
void CMCTool::computeAverageResiduals | ( | SimTK::State & | s, | |
Model & | aModel, | |||
double | aTi, | |||
double | aTf, | |||
const Storage & | aStatesStore, | |||
OpenSim::Array< double > & | rFAve, | |||
OpenSim::Array< double > & | rMAve | |||
) | [static] |
void CMCTool::computeAverageResiduals | ( | const Storage & | aForceStore, | |
OpenSim::Array< double > & | rFAve, | |||
OpenSim::Array< double > & | rMAve | |||
) | [static] |
Compute the average residuals.
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 * CMCTool::constructRRAControlSet | ( | 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.
aControlConstraints | Constraints based on a previous RRA solution to be used during this run of CMC. |
Object * CMCTool::copy | ( | ) | const [virtual] |
bool OpenSim::CMCTool::getAdjustCOMToReduceResiduals | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getAdjustedCOMBody | ( | ) | [inline] |
bool OpenSim::CMCTool::getAdjustKinematicsToReduceResiduals | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getConstraintsFileName | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getDesiredKinematicsFileName | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getDesiredPointsFileName | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getExternalLoadsBody1 | ( | ) | const [inline] |
const std::string& OpenSim::CMCTool::getExternalLoadsBody2 | ( | ) | const [inline] |
const std::string& OpenSim::CMCTool::getExternalLoadsFileName | ( | ) | const [inline] |
const std::string& OpenSim::CMCTool::getExternalLoadsModelKinematicsFileName | ( | ) | const [inline] |
Storage & CMCTool::getForceStorage | ( | ) |
Get a pointer to the Storage object holding forces.
This's a utility routine used by the SimTrack GUI primarily to get access to residuals while running RRA.
User-beware, the storage will get out of scope and potentially get deleted when the analysis is done, so no assumptions about the lifetime of the returned storage object outside the owning analysis should be made.
double OpenSim::CMCTool::getLowpassCutoffFrequency | ( | ) | const [inline] |
double OpenSim::CMCTool::getLowpassCutoffFrequencyForLoadKinematics | ( | ) | const [inline] |
const std::string& OpenSim::CMCTool::getOutputModelFileName | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getRRAControlsFileName | ( | ) | [inline] |
const std::string& OpenSim::CMCTool::getTaskSetFileName | ( | ) | [inline] |
double OpenSim::CMCTool::getTimeWindow | ( | ) | const [inline] |
bool OpenSim::CMCTool::getUseFastTarget | ( | ) | const [inline] |
void CMCTool::initializeControlSetUsingConstraints | ( | const ControlSet * | aRRAControlSet, | |
const ControlSet * | aControlConstraints, | |||
ControlSet & | rControlSet | |||
) |
bool CMCTool::run | ( | ) | [virtual] |
Run the investigation.
Implements OpenSim::AbstractTool.
void OpenSim::CMCTool::setAdjustCOMToReduceResiduals | ( | bool | aAdjust | ) | [inline] |
void OpenSim::CMCTool::setAdjustedCOMBody | ( | const std::string & | aBody | ) | [inline] |
void OpenSim::CMCTool::setAdjustKinematicsToReduceResiduals | ( | bool | aAdjust | ) | [inline] |
void OpenSim::CMCTool::setConstraintsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setDesiredKinematicsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setDesiredPointsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setExternalLoadsBody1 | ( | const std::string & | aName | ) | [inline] |
void OpenSim::CMCTool::setExternalLoadsBody2 | ( | const std::string & | aName | ) | [inline] |
void OpenSim::CMCTool::setExternalLoadsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setExternalLoadsModelKinematicsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setLowpassCutoffFrequency | ( | double | aLowpassCutoffFrequency | ) | [inline] |
void OpenSim::CMCTool::setLowpassCutoffFrequencyForLoadKinematics | ( | double | aLowpassCutoffFrequency | ) | [inline] |
void CMCTool::setOriginalForceSet | ( | const ForceSet & | aForceSet | ) |
void OpenSim::CMCTool::setOutputModelFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setRRAControlsFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setTaskSetFileName | ( | const std::string & | aFileName | ) | [inline] |
void OpenSim::CMCTool::setTimeWindow | ( | double | aTargetDT | ) | [inline] |
void OpenSim::CMCTool::setUseFastTarget | ( | bool | useFastTarget | ) | const [inline] |
void CMCTool::writeAdjustedModel | ( | ) |