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

suTrackObjectSet Class Reference

An class for holding and managing a set of track objects. More...

#include <suTrackObjectSet.h>

Inheritance diagram for suTrackObjectSet:

rdObjectArray rdObject List of all members.

Public Member Functions

 suTrackObjectSet ()
 Construct a default track object set for a specified model.

 suTrackObjectSet (const char *aFileName)
 Construct a track object set from file.

virtual ~suTrackObjectSet ()
 Destructor.

suTrackObjectappendTrackObject (suTrackObject *aObject)
 Append a track object to the set.

suTrackObjectsetTrackObject (int aIndex, suTrackObject *aObject)
 Set the track object at an index.

suTrackObjectgetTrackObject (int aIndex) const
 Get the track object at an index.

void setModel (rdModel *aModel)
 Set the model for which the tracking is performed.

rdModelgetModel () const
 Get the model for which the tracking is performed.

void setFunctions (rdFunctionSet &aFuncSet)
 Set the functions for the track objects.

void setFunctionsForVelocity (rdFunctionSet &aFuncSet)
 Set the velocity functions for the track objects.

void setFunctionsForAcceleration (rdFunctionSet &aFuncSet)
 Set the acceleration functions for the track objects.

rdArray< double > & getPositionErrorsLast ()
 Get the last position errors.

rdArray< double > & getPositionErrors ()
 Get the position errors.

rdArray< double > & getVelocityErrorsLast ()
 Get the last velocity errors.

rdArray< double > & getVelocityErrors ()
 Get the velocity errors.

rdArray< double > & getWeights ()
 Get the array of weights for the desired accelerations.

rdArray< double > & getDesiredAccelerations ()
 Get the desired accelerations.

rdArray< double > & getAccelerations ()
 Get the accelerations.

void recordErrorsAsLastErrors ()
 Record the current position errors of all track objects as the last errors that were achieved during a simulation.

void computeErrors (double aT)
 Compute the errors for all track objects.

void computeDesiredAccelerations (double aT)
 Compute the desired acceleration(s) for each track object.

void computeAccelerations ()
 Compute the acceleration(s) for each track object.

void updateObject (bool aDeep=true)
 Update this object based on its XML node.

void updateNode (bool aDeep=true)
 Update the XML node representing this object.

void generateNode (IDOM_Element *aParent)
 Generate an XML node representing this object.


Static Public Member Functions

void RegisterType (const suTrackObject &aObject)
 Register a supported object type.


Protected Attributes

rdObjectArray _defaultObjects
 Expandable array of default objects.

rdModel_model
 Model for which the tracking is conducted.

rdArray< double > _pErrLast
 Array of last position errors.

rdArray< double > _pErr
 Array of position errors.

rdArray< double > _vErrLast
 Array of last velocity errors.

rdArray< double > _vErr
 Array of velocity errors.

rdArray< double > _w
 Array of weights of the desired acceleration.

rdArray< double > _aDes
 Array of desired accelerations.

rdArray< double > _a
 Array of accelerations.


Private Member Functions

void setNull ()
 Set the data members of this actuator to their null values.

void constructDefaultObjects ()
 Construct the default objects.


Static Private Attributes

rdObjectArray _ObjectTypes
 Expandable array of supported object types.


Detailed Description

An class for holding and managing a set of track objects.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

suTrackObjectSet::suTrackObjectSet  ) 
 

Construct a default track object set for a specified model.

Parameters:
aModel Model for which track objects will be set.

suTrackObjectSet::suTrackObjectSet const char *  aFileName  ) 
 

Construct a track object set from file.

Parameters:
aModel Model for which track objects will be set.
aFileName Name of the file.


Member Function Documentation

suTrackObject * suTrackObjectSet::appendTrackObject suTrackObject aObject  ) 
 

Append a track object to the set.

This method should always return NULL. If it does not return NULL, it means that an object was already stored at what was thought to be the first empty location.

Parameters:
aObject Actuator.
Returns:
Pointer to the actuator previously held.

void suTrackObjectSet::computeAccelerations  ) 
 

Compute the acceleration(s) for each track object.

The methods rdModel::deriv() or rdModel::computeAccelerations must be called before this method is called for the results to be valid.

void suTrackObjectSet::computeDesiredAccelerations double  aT  ) 
 

Compute the desired acceleration(s) for each track object.

Parameters:
aT Time at which the desired accelerations are to be computed in real time units.

void suTrackObjectSet::computeErrors double  aT  ) 
 

Compute the errors for all track objects.

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

void suTrackObjectSet::generateNode IDOM_Element *  aParent  )  [virtual]
 

Generate an XML node representing this object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.

Reimplemented from rdObject.

rdArray< double > & suTrackObjectSet::getAccelerations  ) 
 

Get the accelerations.

Returns:
Array of accelerations.

rdArray< double > & suTrackObjectSet::getDesiredAccelerations  ) 
 

Get the desired accelerations.

Returns:
Array of desired accelerations.

rdModel * suTrackObjectSet::getModel  )  const
 

Get the model for which the tracking is performed.

Returns:
Pointer to the model.

rdArray< double > & suTrackObjectSet::getPositionErrors  ) 
 

Get the position errors.

Returns:
Array of position errors.

rdArray< double > & suTrackObjectSet::getPositionErrorsLast  ) 
 

Get the last position errors.

Returns:
Array of last position errors.

suTrackObject * suTrackObjectSet::getTrackObject int  aIndex  )  const
 

Get the track object at an index.

Parameters:
aIndex Array index of the object to be returned.
Returns:
Object at index aIndex.

rdArray< double > & suTrackObjectSet::getVelocityErrors  ) 
 

Get the velocity errors.

Returns:
Array of velocity errors.

rdArray< double > & suTrackObjectSet::getVelocityErrorsLast  ) 
 

Get the last velocity errors.

Returns:
Array of last velocity errors.

rdArray< double > & suTrackObjectSet::getWeights  ) 
 

Get the array of weights for the desired accelerations.

Returns:
Array of weights.

void suTrackObjectSet::recordErrorsAsLastErrors  ) 
 

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

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

void suTrackObjectSet::RegisterType const suTrackObject aObject  )  [static]
 

Register a supported object type.

Any object type that is supported can be written to and read from an XML file. The object must have implemented the following methods to be supported: 1) copy constructor (e.g., rdForce::rdForce(const rdForce &aForce)) 2) virtual suTrackObject* copy() const, 3) virtual suTrackObject* copy(IDOM_Element*) const, 4) suTrackObject& operator=() (!! with the appropriate return type), 5) virtual void updateObject(bool aDeep=true), 6) virtual void updateNode(bool aDeep=true), and 7) virtual void generateNode(IDOM_Element *aParent).

Because this method is static, registration of object types needs to be done only once per process and an suTrackObjectSet does not need to be instantiated to do so.

This method makes a copy of the specified object, so the caller may continue to use the spacified object for whatever purpose.

Parameters:
aObject Object of the type to be added.

void suTrackObjectSet::setFunctions rdFunctionSet aFuncSet  ) 
 

Set the functions for the track objects.

Functions are set based on the correspondence of the function and the track object. For example, a track object with the name "x" will search for a function or functions with the name "x". For track objects that require 3 functions, such as suTrackPoint objects, 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 track object is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.

void suTrackObjectSet::setFunctionsForAcceleration rdFunctionSet aFuncSet  ) 
 

Set the acceleration functions for the track objects.

Functions are set based on the correspondence of the function and the track object. For example, a track object with the name "x" will search for a function or functions with the name "x". For track objects that require 3 functions, such as suTrackPoint objects, 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 track object is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.

void suTrackObjectSet::setFunctionsForVelocity rdFunctionSet aFuncSet  ) 
 

Set the velocity functions for the track objects.

Functions are set based on the correspondence of the function and the track object. For example, a track object with the name "x" will search for a function or functions with the name "x". For track objects that require 3 functions, such as suTrackPoint objects, 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 track object is disabled.

Parameters:
aFuncSet Function set.
Returns:
Pointer to the previous function set.

void suTrackObjectSet::setModel rdModel aModel  ) 
 

Set the model for which the tracking is performed.

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

Parameters:
aModel Model.

suTrackObject * suTrackObjectSet::setTrackObject int  aIndex,
suTrackObject aObject
 

Set the track object at an index.

Sending in NULL for the suTrackObject pointer essentially removes the object at aIndex from the array. Note that the caller is responsible for deleting any objects that are removed from this list in this way. For this reason, the object pointer previously held at aIndex is returned by this method.

It is also permissible to send in any positive value for aIndex, and there can be gaps in the array of actuators. However, it is advisible to use appendTrackObject(suTrackObject*) when adding an actutor so the array of actuators remains contiguous.

Parameters:
aIndex Array index where the actuator is to be stored.
aObject Object pointer.
Returns:
Pointer to the object previously held at aIndex.

void suTrackObjectSet::updateObject bool  aDeep = true  )  [virtual]
 

Update this object based on its XML node.

Parameters:
aDeep If true, update this object and all its child objects (that is, member variables that are rdObject's); if false, update only the member variables that are not rdObject's.

Reimplemented from rdObjectArray.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:15 2003 for Simulation Software by doxygen1.3