OpenSim::CMC_TaskSet Class Reference

An class for holding and managing a set of tasks. More...

#include <CMC_TaskSet.h>

Inheritance diagram for OpenSim::CMC_TaskSet:
OpenSim::Set< CMC_Task > OpenSim::Object

List of all members.

Public Member Functions

 CMC_TaskSet ()
 Construct a default task set for a specified model.
 CMC_TaskSet (const std::string &aFileName)
virtual ~CMC_TaskSet ()
 Destructor.
void setModel (Model &aModel)
 Set the model for which the tracking is performed.
ModelgetModel () const
 Get the model for which the tracking is performed.
void setFunctions (FunctionSet &aFuncSet)
 Set the functions for the tasks.
void setFunctionsForVelocity (FunctionSet &aFuncSet)
 Set the velocity functions for the tasks.
void setFunctionsForAcceleration (FunctionSet &aFuncSet)
 Set the acceleration functions for the tasks.
int getNumActiveTaskFunctions () const
 Return number of active task functions.
Array< double > & getTaskPositions (double aT)
 Get all active task positions.
Array< double > & getTaskVelocities (double aT)
 Get all active task velocities.
Array< double > & getTaskAccelerations (double aT)
 Get all active task accelerations.
Array< double > & getPositionGains ()
 Get all active gains for position errors.
Array< double > & getVelocityGains ()
 Get all active gains for velocity errors.
Array< double > & getAccelerationGains ()
 Get all active gains for acceleration errors.
Array< double > & getPositionErrorsLast ()
 Get the last position errors.
Array< double > & getPositionErrors ()
 Get the position errors.
Array< double > & getVelocityErrorsLast ()
 Get the last velocity errors.
Array< double > & getVelocityErrors ()
 Get the velocity errors.
Array< double > & getWeights ()
 Get the array of weights for the desired accelerations.
Array< double > & getDesiredAccelerations ()
 Get the desired accelerations.
Array< double > & getAccelerations ()
 Get the accelerations.
void recordErrorsAsLastErrors ()
 Record the current position errors of all tasks as the last errors that were achieved during a simulation.
void computeErrors (const SimTK::State &s, double aT)
 Compute the errors for all tasks.
void computeDesiredAccelerations (const SimTK::State &s, double aT)
 Compute the desired acceleration(s) for each task at a specified time.
void computeDesiredAccelerations (const SimTK::State &s, double aTCurrent, double aTFuture)
 Compute the desired acceleration(s) for each task given a time interval over which the accelerations are to be achieved.
void computeAccelerations (const SimTK::State &s)
 Compute the acceleration(s) for each task.

Protected Attributes

Model_model
 Model for which the tracking is conducted.
Array< double > _pTask
 Array of task positions.
Array< double > _vTask
 Array of task velocities.
Array< double > _aTask
 Array of task accelerations.
Array< double > _pErrLast
 Array of last position errors.
Array< double > _pErr
 Array of position errors.
Array< double > _vErrLast
 Array of last velocity errors.
Array< double > _vErr
 Array of velocity errors.
Array< double > _kp
 Array of gains for the position errors.
Array< double > _kv
 Array of gains for the velocity errors.
Array< double > _ka
 Array of gains for the acceleration errors.
Array< double > _w
 Array of weights of the desired acceleration.
Array< double > _aDes
 Array of desired accelerations.
Array< double > _a
 Array of accelerations.

Detailed Description

An class for holding and managing a set of tasks.

Author:
Frank C. Anderson
Version:
1.0

Constructor & Destructor Documentation

CMC_TaskSet::CMC_TaskSet (  ) 

Construct a default task set for a specified model.

Parameters:
aModel Model for which tasks will be set.
OpenSim::CMC_TaskSet::CMC_TaskSet ( const std::string &  aFileName  ) 
CMC_TaskSet::~CMC_TaskSet (  )  [virtual]

Destructor.


Member Function Documentation

void CMC_TaskSet::computeAccelerations ( const SimTK::State &  s  ) 

Compute the acceleration(s) for each task.

Model::computeAccelerations must be called before this method is called for the results to be valid.

void CMC_TaskSet::computeDesiredAccelerations ( const SimTK::State &  s,
double  aTI,
double  aTF 
)

Compute the desired acceleration(s) for each task given a time interval over which the accelerations are to be achieved.

Currently, the algorithm is to compute the position and velocity error terms at the initial time and the acceleration term from the task set at the final time.

Parameters:
aTI Initial time of the time interval in real time units.
aTF Final time of the timer interval in real time units.
void CMC_TaskSet::computeDesiredAccelerations ( const SimTK::State &  s,
double  aT 
)

Compute the desired acceleration(s) for each task at a specified time.

Parameters:
aT Time at which the desired accelerations are to be computed in real time units.
void CMC_TaskSet::computeErrors ( const SimTK::State &  s,
double  aT 
)

Compute the errors for all tasks.

Parameters:
aT Time at which to compute the errors in real time units.
OpenSim::Array< double > & CMC_TaskSet::getAccelerationGains (  ) 

Get all active gains for acceleration errors.

Parameters:
aT Time (in real time units).
Returns:
Array of velocity gains.
OpenSim::Array< double > & CMC_TaskSet::getAccelerations (  ) 

Get the accelerations.

Returns:
Array of accelerations.
OpenSim::Array< double > & CMC_TaskSet::getDesiredAccelerations (  ) 

Get the desired accelerations.

Returns:
Array of desired accelerations.
Model * CMC_TaskSet::getModel (  )  const

Get the model for which the tracking is performed.

Returns:
Pointer to the model.
int CMC_TaskSet::getNumActiveTaskFunctions (  )  const

Return number of active task functions.

OpenSim::Array< double > & CMC_TaskSet::getPositionErrors (  ) 

Get the position errors.

Returns:
Array of position errors.
OpenSim::Array< double > & CMC_TaskSet::getPositionErrorsLast (  ) 

Get the last position errors.

Returns:
Array of last position errors.
OpenSim::Array< double > & CMC_TaskSet::getPositionGains (  ) 

Get all active gains for position errors.

Parameters:
aT Time (in real time units).
Returns:
Array of position gains.
OpenSim::Array< double > & CMC_TaskSet::getTaskAccelerations ( double  aT  ) 

Get all active task accelerations.

Parameters:
aT Time (in real time units).
Returns:
Array of task accelerations.
OpenSim::Array< double > & CMC_TaskSet::getTaskPositions ( double  aT  ) 

Get all active task positions.

Parameters:
aT Time (in real time units).
Returns:
Array of task positions.
OpenSim::Array< double > & CMC_TaskSet::getTaskVelocities ( double  aT  ) 

Get all active task velocities.

Parameters:
aT Time (in real time units).
Returns:
Array of task velocities.
OpenSim::Array< double > & CMC_TaskSet::getVelocityErrors (  ) 

Get the velocity errors.

Returns:
Array of velocity errors.
OpenSim::Array< double > & CMC_TaskSet::getVelocityErrorsLast (  ) 

Get the last velocity errors.

Returns:
Array of last velocity errors.
OpenSim::Array< double > & CMC_TaskSet::getVelocityGains (  ) 

Get all active gains for velocity errors.

Parameters:
aT Time (in real time units).
Returns:
Array of velocity gains.
OpenSim::Array< double > & CMC_TaskSet::getWeights (  ) 

Get the array of weights for the desired accelerations.

Returns:
Array of weights.
void CMC_TaskSet::recordErrorsAsLastErrors (  ) 

Record the current position errors of all tasks as the last errors that were achieved during a simulation.

This method assumes that the position errors have already been computed.

void CMC_TaskSet::setFunctions ( FunctionSet aFuncSet  ) 

Set the functions for the tasks.

Functions are set based on the correspondence of the function and the task. For example, a task with the name "x" will search for a function or functions with the name "x". For tasks that require 3 functions, such as CMC_Point tasks, the assumption is that there will be three consecutive functions named "x" in the function set. If the correct number of functions is not found, the task is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.
void CMC_TaskSet::setFunctionsForAcceleration ( FunctionSet aFuncSet  ) 

Set the acceleration functions for the tasks.

Functions are set based on the correspondence of the function and the task. For example, a task with the name "x" will search for a function or functions with the name "x". For tasks that require 3 functions, such as CMC_Point tasks, the assumption is that there will be three consecutive functions named "x" in the function set. If the correct number of functions is not found, the task is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.
void CMC_TaskSet::setFunctionsForVelocity ( FunctionSet aFuncSet  ) 

Set the velocity functions for the tasks.

Functions are set based on the correspondence of the function and the task. For example, a task with the name "x" will search for a function or functions with the name "x". For tasks that require 3 functions, such as CMC_Point tasks, the assumption is that there will be three consecutive functions named "x" in the function set. If the correct number of functions is not found, the task is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.
void CMC_TaskSet::setModel ( Model aModel  ) 

Set the model for which the tracking is performed.

The model is set for all tasks that are currently being managed by this set.

Parameters:
aModel Model.

Member Data Documentation

Array<double> OpenSim::CMC_TaskSet::_a [protected]

Array of accelerations.

Array<double> OpenSim::CMC_TaskSet::_aDes [protected]

Array of desired accelerations.

Array<double> OpenSim::CMC_TaskSet::_aTask [protected]

Array of task accelerations.

Array<double> OpenSim::CMC_TaskSet::_ka [protected]

Array of gains for the acceleration errors.

Array<double> OpenSim::CMC_TaskSet::_kp [protected]

Array of gains for the position errors.

Array<double> OpenSim::CMC_TaskSet::_kv [protected]

Array of gains for the velocity errors.

Model for which the tracking is conducted.

Array<double> OpenSim::CMC_TaskSet::_pErr [protected]

Array of position errors.

Array of last position errors.

Array<double> OpenSim::CMC_TaskSet::_pTask [protected]

Array of task positions.

Array<double> OpenSim::CMC_TaskSet::_vErr [protected]

Array of velocity errors.

Array of last velocity errors.

Array<double> OpenSim::CMC_TaskSet::_vTask [protected]

Array of task velocities.

Array<double> OpenSim::CMC_TaskSet::_w [protected]

Array of weights of the desired acceleration.


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

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