OpenSim::RRATool Class Reference

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

#include <RRATool.h>

Inheritance diagram for OpenSim::RRATool:
OpenSim::AbstractTool OpenSim::Object

List of all members.

Public Member Functions

virtual ~RRATool ()
 Destructor.
 RRATool ()
 Default constructor.
 RRATool (const std::string &aFileName, bool aLoadModel=true) SWIG_DECLARE_EXCEPTION
 RRATool (const RRATool &aObject)
 Copy constructor.
virtual Objectcopy () const
 Virtual copy constructor.
RRATooloperator= (const RRATool &aRRATool)
 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)
double getLowpassCutoffFrequency () const
void setLowpassCutoffFrequency (double aLowpassCutoffFrequency)
const std::string & getExternalLoadsFileName () const
void setExternalLoadsFileName (const std::string &aFileName)
virtual bool run () SWIG_DECLARE_EXCEPTION
 Run the investigation.
StoragegetForceStorage ()
 Get a pointer to the Storage object holding forces.
void setOriginalForceSet (const ForceSet &aForceSet)
virtual void updateFromXMLNode ()
 Override default implementation by object to intercept and fix the XML node underneath the tool to match current version, issue warning for unexpected inputs.
ControlSetconstructRRAControlSet (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)

Detailed Description

An abstract class for specifying the interface for an investigation.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

RRATool::~RRATool (  )  [virtual]

Destructor.

RRATool::RRATool (  ) 

Default constructor.

OpenSim::RRATool::RRATool ( const std::string &  aFileName,
bool  aLoadModel = true 
)
RRATool::RRATool ( const RRATool 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 (

See also:
Tool(const char *aFileName)). In this case, the XML document is created by parsing the 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.).

Parameters:
aTool Object to be copied.
See also:
Tool(const XMLDocument *aDocument)
Tool(const char *aFileName)
generateXMLDocument()

Member Function Documentation

void RRATool::addNecessaryAnalyses (  ) 

Add Actuation/Kinematics analyses if necessary.

void RRATool::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 RRATool::adjustCOMToReduceResiduals ( SimTK::State &  s,
const Storage qStore,
const Storage uStore 
)
void RRATool::computeAverageResiduals ( SimTK::State &  s,
Model aModel,
double  aTi,
double  aTf,
const Storage aStatesStore,
OpenSim::Array< double > &  rFAve,
OpenSim::Array< double > &  rMAve 
) [static]
void RRATool::computeAverageResiduals ( const Storage aForceStore,
OpenSim::Array< double > &  rFAve,
OpenSim::Array< double > &  rMAve 
) [static]

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 * RRATool::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.

Parameters:
aControlConstraints Constraints based on a previous RRA solution to be used during this run of CMC.
Object * RRATool::copy (  )  const [virtual]

Virtual copy constructor.

Returns:
Copy of this object.

Reimplemented from OpenSim::Object.

bool OpenSim::RRATool::getAdjustCOMToReduceResiduals (  )  [inline]
const std::string& OpenSim::RRATool::getAdjustedCOMBody (  )  [inline]
const std::string& OpenSim::RRATool::getConstraintsFileName (  )  [inline]
const std::string& OpenSim::RRATool::getDesiredKinematicsFileName (  )  [inline]
const std::string& OpenSim::RRATool::getDesiredPointsFileName (  )  [inline]
const std::string& OpenSim::RRATool::getExternalLoadsFileName (  )  const [inline]

Reimplemented from OpenSim::AbstractTool.

Storage & RRATool::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::RRATool::getLowpassCutoffFrequency (  )  const [inline]
const std::string& OpenSim::RRATool::getOutputModelFileName (  )  [inline]
const std::string& OpenSim::RRATool::getRRAControlsFileName (  )  [inline]
const std::string& OpenSim::RRATool::getTaskSetFileName (  )  [inline]
void RRATool::initializeControlSetUsingConstraints ( const ControlSet aRRAControlSet,
const ControlSet aControlConstraints,
ControlSet rControlSet 
)

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.
RRATool & RRATool::operator= ( const RRATool aTool  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::AbstractTool.

bool RRATool::run (  )  [virtual]

Run the investigation.

Implements OpenSim::AbstractTool.

void OpenSim::RRATool::setAdjustCOMToReduceResiduals ( bool  aAdjust  )  [inline]
void OpenSim::RRATool::setAdjustedCOMBody ( const std::string &  aBody  )  [inline]
void OpenSim::RRATool::setConstraintsFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::RRATool::setDesiredKinematicsFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::RRATool::setDesiredPointsFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::RRATool::setExternalLoadsFileName ( const std::string &  aFileName  )  [inline]

Reimplemented from OpenSim::AbstractTool.

void OpenSim::RRATool::setLowpassCutoffFrequency ( double  aLowpassCutoffFrequency  )  [inline]
void RRATool::setOriginalForceSet ( const ForceSet aForceSet  ) 
void OpenSim::RRATool::setOutputModelFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::RRATool::setRRAControlsFileName ( const std::string &  aFileName  )  [inline]
void OpenSim::RRATool::setTaskSetFileName ( const std::string &  aFileName  )  [inline]
void RRATool::updateFromXMLNode (  )  [virtual]

Override default implementation by object to intercept and fix the XML node underneath the tool to match current version, issue warning for unexpected inputs.

Reimplemented from OpenSim::AbstractTool.

void RRATool::writeAdjustedModel (  ) 

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

Generated on Sun Sep 25 00:20:07 2011 for OpenSim by  doxygen 1.6.1