OpenSim::BodyKinematics Class Reference

A class for recording the kinematics of the bodies of a model during a simulation. More...

#include <BodyKinematics.h>

Inheritance diagram for OpenSim::BodyKinematics:
OpenSim::Analysis OpenSim::Object

List of all members.

Public Member Functions

 BodyKinematics (Model *aModel=0, bool aInDegrees=true)
 Construct an BodyKinematics instance for recording the kinematics of the bodies of a model during a simulation.
 BodyKinematics (const std::string &aFileName)
 Construct an object from file.
 BodyKinematics (const BodyKinematics &aObject)
 Copy constructor.
virtual Objectcopy () const
 Clone.
virtual ~BodyKinematics ()
 Destructor.
BodyKinematicsoperator= (const BodyKinematics &aBodyKinematics)
 Assign this object to the values of another.
void setStorageCapacityIncrements (int aIncrement)
 Set the capacity increments of all storage instances.
StoragegetAccelerationStorage ()
 Get the acceleration storage.
StoragegetVelocityStorage ()
 Get the velocity storage.
StoragegetPositionStorage ()
 Get the position storage.
void setExpressResultsInLocalFrame (bool aTrueFalse)
 Set a flag indicating that the angular velocities should be output in the the body local reference frame.
bool getExpressResultsInLocalFrame ()
 Get a flag indicating whether the angular velocities should be output in the the body local reference frame.
void setRecordCenterOfMass (bool aTrueFalse)
void setBodiesToRecord (Array< std::string > &listOfBodies)
virtual void setModel (Model &aModel)
 Set the model for which the body kinematics are to be computed.
virtual int begin (SimTK::State &s)
 This method is called at the beginning of an analysis so that any necessary initializations may be performed.
virtual int step (const SimTK::State &s, int setNumber)
 This method is called to perform the analysis.
virtual int end (SimTK::State &s)
 This method is called at the end of an analysis so that any necessary finalizations may be performed.
virtual int printResults (const std::string &aBaseName, const std::string &aDir="", double aDT=-1.0, const std::string &aExtension=".sto")
 Print the results of the analysis.

Protected Member Functions

virtual int record (const SimTK::State &s)
 Record the kinematics.

Protected Attributes

PropertyStrArray _bodiesProp
 Names of bodies whose kinematics are to be recorded.
Array< std::string > & _bodies
PropertyBool _expressInLocalFrameProp
 Flag indicating whether or not to express the results in the global or body-local frame.
bool & _expressInLocalFrame
Array< int > _bodyIndices
bool _recordCenterOfMass
Array< double > _kin
Storage_pStore
Storage_vStore
Storage_aStore

Detailed Description

A class for recording the kinematics of the bodies of a model during a simulation.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

BodyKinematics::BodyKinematics ( Model aModel = 0,
bool  aInDegrees = true 
)

Construct an BodyKinematics instance for recording the kinematics of the bodies of a model during a simulation.

Parameters:
aModel Model for which the analyses are to be recorded.
BodyKinematics::BodyKinematics ( const std::string &  aFileName  ) 

Construct an object from file.

The object is constructed from the root element of the XML document. The type of object is the tag name of the XML root element.

Parameters:
aFileName File name of the document.
BodyKinematics::BodyKinematics ( const BodyKinematics aObject  ) 

Copy constructor.

BodyKinematics::~BodyKinematics (  )  [virtual]

Destructor.


Member Function Documentation

int BodyKinematics::begin ( SimTK::State &  s  )  [virtual]

This method is called at the beginning of an analysis so that any necessary initializations may be performed.

This method is meant to be called at the begining of an integration

This method should be overriden in the child class. It is included here so that the child class will not have to implement it if it is not necessary.

Parameters:
s System state
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

Object * BodyKinematics::copy (  )  const [virtual]

Clone.

Reimplemented from OpenSim::Analysis.

int BodyKinematics::end ( SimTK::State &  s  )  [virtual]

This method is called at the end of an analysis so that any necessary finalizations may be performed.

This method is meant to be called at the end of an integration

This method should be overriden in the child class. It is included here so that the child class will not have to implement it if it is not necessary.

Parameters:
s System state
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

Storage * BodyKinematics::getAccelerationStorage (  ) 

Get the acceleration storage.

Returns:
Acceleration storage.
bool BodyKinematics::getExpressResultsInLocalFrame (  ) 

Get a flag indicating whether the angular velocities should be output in the the body local reference frame.

Parameters:
rTrueFalse False indicates the angular velocities being output in the global reference frame
Storage * BodyKinematics::getPositionStorage (  ) 

Get the position storage.

Returns:
Position storage.
Storage * BodyKinematics::getVelocityStorage (  ) 

Get the velocity storage.

Returns:
Velocity storage.
BodyKinematics & BodyKinematics::operator= ( const BodyKinematics aBodyKinematics  ) 

Assign this object to the values of another.

Returns:
Reference to this object.

Reimplemented from OpenSim::Analysis.

virtual int OpenSim::BodyKinematics::printResults ( const std::string &  aBaseName,
const std::string &  aDir = "",
double  aDT = -1.0,
const std::string &  aExtension = ".sto" 
) [virtual]

Print the results of the analysis.

Parameters:
aFileName File to which to print the data.
aDT Time interval between results (linear interpolation is used). If not included as an argument or negative, all time steps are printed without interpolation.
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

int BodyKinematics::record ( const SimTK::State &  s  )  [protected, virtual]

Record the kinematics.

void OpenSim::BodyKinematics::setBodiesToRecord ( Array< std::string > &  listOfBodies  )  [inline]
void BodyKinematics::setExpressResultsInLocalFrame ( bool  aTrueFalse  ) 

Set a flag indicating that the angular velocities should be output in the the body local reference frame.

Parameters:
aTrueFalse False will result in the angular velocities being output in the global reference frame
void BodyKinematics::setModel ( Model aModel  )  [virtual]

Set the model for which the body kinematics are to be computed.

Parameters:
aModel Model pointer

Reimplemented from OpenSim::Analysis.

void OpenSim::BodyKinematics::setRecordCenterOfMass ( bool  aTrueFalse  )  [inline]
void BodyKinematics::setStorageCapacityIncrements ( int  aIncrement  ) 

Set the capacity increments of all storage instances.

Parameters:
aIncrement Increment by which storage capacities will be increased when storage capcities run out.
int BodyKinematics::step ( const SimTK::State &  s,
int  stepNumber 
) [virtual]

This method is called to perform the analysis.

It can be called during the execution of a forward integrations or after the integration by feeding it the necessary data.

When called during an integration, this method is meant to be called

This method should be overriden in derived classes. It is included here so that the derived class will not have to implement it if it is not necessary.

Parameters:
s System state
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.


Member Data Documentation

Array<std::string>& OpenSim::BodyKinematics::_bodies [protected]

Names of bodies whose kinematics are to be recorded.

Flag indicating whether or not to express the results in the global or body-local frame.

Array<double> OpenSim::BodyKinematics::_kin [protected]

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

Generated on Sun Sep 25 00:19:46 2011 for OpenSim by  doxygen 1.6.1