Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

rdCMC_TaskSet Class Reference

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

#include <rdCMC_TaskSet.h>

List of all members.

Public Member Functions

 rdCMC_TaskSet ()
 Construct a default task set for a specified model.
 rdCMC_TaskSet (const char *aFileName)
 Construct a task set from file.
virtual ~rdCMC_TaskSet ()
 Destructor.
void setModel (OpenSim::Model *aModel)
 Set the model for which the tracking is performed.
OpenSim::Model * getModel () const
 Get the model for which the tracking is performed.
void setParametersBasedOnName ()
 Set the parameters for each task in this set based on the name of each task in this set.
void setFunctions (OpenSim::FunctionSet &aFuncSet)
 Set the functions for the tasks.
void setFunctionsForVelocity (OpenSim::FunctionSet &aFuncSet)
 Set the velocity functions for the tasks.
void setFunctionsForAcceleration (OpenSim::FunctionSet &aFuncSet)
 Set the acceleration functions for the tasks.
OpenSim::Array< double > & getTaskPositions (double aT)
 Get all active task positions.
OpenSim::Array< double > & getTaskVelocities (double aT)
 Get all active task velocities.
OpenSim::Array< double > & getTaskAccelerations (double aT)
 Get all active task accelerations.
OpenSim::Array< double > & getPositionGains ()
 Get all active gains for position errors.
OpenSim::Array< double > & getVelocityGains ()
 Get all active gains for velocity errors.
OpenSim::Array< double > & getAccelerationGains ()
 Get all active gains for acceleration errors.
OpenSim::Array< double > & getPositionErrorsLast ()
 Get the last position errors.
OpenSim::Array< double > & getPositionErrors ()
 Get the position errors.
OpenSim::Array< double > & getVelocityErrorsLast ()
 Get the last velocity errors.
OpenSim::Array< double > & getVelocityErrors ()
 Get the velocity errors.
OpenSim::Array< double > & getWeights ()
 Get the array of weights for the desired accelerations.
OpenSim::Array< double > & getDesiredAccelerations ()
 Get the desired accelerations.
OpenSim::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 (double aT)
 Compute the errors for all tasks.
void computeDesiredAccelerations (double aT)
 Compute the desired acceleration(s) for each task at a specified time.
void computeDesiredAccelerations (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 ()
 Compute the acceleration(s) for each task.

Protected Attributes

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

Private Member Functions

void setNull ()
 Set the data members of this actuator to their null values.
void setupProperties ()
 Set up the serialized member variables.


Detailed Description

An class for holding and managing a set of tasks.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdCMC_TaskSet::rdCMC_TaskSet  ) 
 

Construct a default task set for a specified model.

Parameters:
aModel Model for which tasks will be set.

rdCMC_TaskSet::rdCMC_TaskSet const char *  aFileName  ) 
 

Construct a task set from file.

Parameters:
aFileName Name of the file.


Member Function Documentation

void rdCMC_TaskSet::computeAccelerations  ) 
 

Compute the acceleration(s) for each task.

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

void rdCMC_TaskSet::computeDesiredAccelerations 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 rdCMC_TaskSet::computeDesiredAccelerations 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 rdCMC_TaskSet::computeErrors double  aT  ) 
 

Compute the errors for all tasks.

Parameters:
aT Time at which to compute the errors in real time units.

Array< double > & rdCMC_TaskSet::getAccelerationGains  ) 
 

Get all active gains for acceleration errors.

Parameters:
aT Time (in real time units).
Returns:
Array of velocity gains.

Array< double > & rdCMC_TaskSet::getAccelerations  ) 
 

Get the accelerations.

Returns:
Array of accelerations.

Array< double > & rdCMC_TaskSet::getDesiredAccelerations  ) 
 

Get the desired accelerations.

Returns:
Array of desired accelerations.

Model * rdCMC_TaskSet::getModel  )  const
 

Get the model for which the tracking is performed.

Returns:
Pointer to the model.

Array< double > & rdCMC_TaskSet::getPositionErrors  ) 
 

Get the position errors.

Returns:
Array of position errors.

Array< double > & rdCMC_TaskSet::getPositionErrorsLast  ) 
 

Get the last position errors.

Returns:
Array of last position errors.

Array< double > & rdCMC_TaskSet::getPositionGains  ) 
 

Get all active gains for position errors.

Parameters:
aT Time (in real time units).
Returns:
Array of position gains.

Array< double > & rdCMC_TaskSet::getTaskAccelerations double  aT  ) 
 

Get all active task accelerations.

Parameters:
aT Time (in real time units).
Returns:
Array of task accelerations.

Array< double > & rdCMC_TaskSet::getTaskPositions double  aT  ) 
 

Get all active task positions.

Parameters:
aT Time (in real time units).
Returns:
Array of task positions.

Array< double > & rdCMC_TaskSet::getTaskVelocities double  aT  ) 
 

Get all active task velocities.

Parameters:
aT Time (in real time units).
Returns:
Array of task velocities.

Array< double > & rdCMC_TaskSet::getVelocityErrors  ) 
 

Get the velocity errors.

Returns:
Array of velocity errors.

Array< double > & rdCMC_TaskSet::getVelocityErrorsLast  ) 
 

Get the last velocity errors.

Returns:
Array of last velocity errors.

Array< double > & rdCMC_TaskSet::getVelocityGains  ) 
 

Get all active gains for velocity errors.

Parameters:
aT Time (in real time units).
Returns:
Array of velocity gains.

Array< double > & rdCMC_TaskSet::getWeights  ) 
 

Get the array of weights for the desired accelerations.

Returns:
Array of weights.

void rdCMC_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 rdCMC_TaskSet::setFunctions OpenSim::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 rdCMC_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 rdCMC_TaskSet::setFunctionsForAcceleration OpenSim::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 rdCMC_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 rdCMC_TaskSet::setFunctionsForVelocity OpenSim::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 rdCMC_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 rdCMC_TaskSet::setModel OpenSim::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.

void rdCMC_TaskSet::setParametersBasedOnName  ) 
 

Set the parameters for each task in this set based on the name of each task in this set.

Parameters:
aModel Model.


The documentation for this class was generated from the following files:
Generated on Wed Nov 1 16:04:32 2006 for Computed Muscle Control (CMC) API by doxygen 1.3.8