OpenSim::Kinematics Class Reference

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

#include <Kinematics.h>

Inheritance diagram for OpenSim::Kinematics:
OpenSim::Analysis OpenSim::Object

List of all members.

Public Member Functions

 Kinematics (Model *aModel=0)
 Construct an Kinematics object for recording the kinematics of a model's generalized coodinates during a simulation.
 Kinematics (const std::string &aFileName)
 Construct an object from file.
 Kinematics (const Kinematics &aObject)
 Copy constructor.
virtual Objectcopy () const
 Clone.
virtual ~Kinematics ()
 Destructor.
Kinematicsoperator= (const Kinematics &aKinematics)
 Assignment operator.
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.
virtual void setModel (Model &aModel)
 Set the model pointer for analyzing kinematics.
void setRecordAccelerations (bool aRecordAccelerations)
virtual int begin (const 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)
 This method is called to perform the analysis.
virtual int end (const 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 _coordinatesProp
 Names of generalized coordinates whose kinematics are to be recorded.
Array< std::string > & _coordinates
Array< int > _coordinateIndices
Array< double > _values
double * _q
double * _u
double * _udot
Storage_pStore
Storage_vStore
Storage_aStore
bool _recordAccelerations

Detailed Description

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

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

Kinematics::Kinematics ( Model aModel = 0  ) 

Construct an Kinematics object for recording the kinematics of a model's generalized coodinates during a simulation.

Parameters:
aModel Model for which the kinematics are to be recorded.
Kinematics::Kinematics ( 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.
Kinematics::Kinematics ( const Kinematics aObject  ) 

Copy constructor.

Kinematics::~Kinematics (  )  [virtual]

Destructor.


Member Function Documentation

int Kinematics::begin ( const 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

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

Reimplemented from OpenSim::Analysis.

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

Clone.

Reimplemented from OpenSim::Analysis.

int Kinematics::end ( const 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 current state of System
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.

Storage * Kinematics::getAccelerationStorage (  ) 

Get the acceleration storage.

Returns:
Acceleration storage.
Storage * Kinematics::getPositionStorage (  ) 

Get the position storage.

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

Get the velocity storage.

Returns:
Velocity storage.
Kinematics & Kinematics::operator= ( const Kinematics aAnalysis  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Analysis.

virtual int OpenSim::Kinematics::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 Kinematics::record ( const SimTK::State &  s  )  [protected, virtual]

Record the kinematics.

Returns:
0 of success, -1 on error.
void Kinematics::setModel ( Model aModel  )  [virtual]

Set the model pointer for analyzing kinematics.

Reimplemented from OpenSim::Analysis.

void OpenSim::Kinematics::setRecordAccelerations ( bool  aRecordAccelerations  )  [inline]
void Kinematics::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 Kinematics::step ( const SimTK::State &  s  )  [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 current state of system
Returns:
-1 on error, 0 otherwise.

Reimplemented from OpenSim::Analysis.


Member Data Documentation

Array<std::string>& OpenSim::Kinematics::_coordinates [protected]

Names of generalized coordinates whose kinematics are to be recorded.

double* OpenSim::Kinematics::_q [protected]
double* OpenSim::Kinematics::_u [protected]
double* OpenSim::Kinematics::_udot [protected]
Array<double> OpenSim::Kinematics::_values [protected]

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

Generated on Wed Dec 16 15:03:39 2009 for OpenSim by  doxygen 1.6.1