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

suTrackObject Class Reference

An abstract base class for specifying an object that is to be tracked during a dynamic simulation. More...

#include <suTrackObject.h>

Inheritance diagram for suTrackObject:

rdObject suTrackJoint suTrackOrientation suTrackPoint List of all members.

Public Member Functions

 suTrackObject ()
 Construct a default track object for a specified model.

 suTrackObject (IDOM_Element *aElement)
 Construct a track object from an XML Element.

 suTrackObject (const suTrackObject &aTrackObject)
 Copy constructor.

virtual ~suTrackObject ()
 Destructor.

virtual suTrackObject * copy () const=0
virtual suTrackObject * copy (IDOM_Element *aElement) const=0
suTrackObject & operator= (const suTrackObject &aTrackObject)
 Assignment operator.

void setModel (rdModel *aModel)
 Set the model to which this track object applies.

rdModelgetModel () const
 Get the model to which this track object applies.

void setOn (bool aTrueFalse)
 Turn this track object on or off.

bool getOn () const
 Get whether or not this track object is on.

void setWRTBody (int aBody)
 Set the body with respect to (WRT) which the track goals are specified.

int getWRTBody () const
 Get the body with respect to (WRT) which the track goals are specified.

void setExpressBody (int aBody)
 Set the body in which the track goals are expressed.

int getExpressBody () const
 Get the body in which the track goals are expressed.

void setActive (bool a0, bool a1=false, bool a2=false)
 Set whether or not track goals are active.

bool getActive (int aWhich) const
 Get whether a specified track goal is active.

void setWeight (double aW0, double aW1=0.0, double aW2=0.0)
 Set the weight of each track goal.

double getWeight (int aWhich) const
 Get the weight of each track goal.

void setKP (double aK0, double aK1=0.0, double aK2=0.0)
 Set the position gains for each track goal.

double getKP (int aWhich) const
 Get the position gain for a specified track goal.

void setKV (double aK0, double aK1=0.0, double aK2=0.0)
 Set the velocity gains for each track goal.

double getKV (int aWhich) const
 Get the velocity gain for a specified track goal.

void setKA (double aK0, double aK1=0.0, double aK2=0.0)
 Set the acceleration gains for each track goal.

double getKA (int aWhich) const
 Get the acceleration gain for a specified track goal.

void setDirection_0 (const double aR[3])
 Set the direction of track goal 0.

void getDirection_0 (double rR[3]) const
 Get the direction of track goal 0.

void setDirection_1 (const double aR[3])
 Set the direction of track goal 1.

void getDirection_1 (double rR[3]) const
 Get the direction of track goal 1.

void setDirection_2 (const double aR[3])
 Set the direction of track goal 2.

void getDirection_2 (double rR[3]) const
 Get the direction of track goal 2.

int getNumTrackFunctions () const
 Get the number of position track functions.

void setTrackFunctions (rdFunction *aF0, rdFunction *aF1=NULL, rdFunction *aF2=NULL)
 Set the track functions.

rdFunctiongetTrackFunction (int aWhich) const
 Get a specified track function.

void setTrackFunctionsForVelocity (rdFunction *aF0, rdFunction *aF1=NULL, rdFunction *aF2=NULL)
 Set the velocity track functions.

rdFunctiongetTrackFunctionForVelocity (int aWhich) const
 Get a specified velocity track function.

void setTrackFunctionsForAcceleration (rdFunction *aF0, rdFunction *aF1=NULL, rdFunction *aF2=NULL)
 Set the acceleration track functions.

rdFunctiongetTrackFunctionForAcceleration (int aWhich) const
 Get a specified acceleration track function.

void setPositionErrorLast (double aE0, double aE1=0.0, double aE2=0.0)
 Set the last achieved position error.

double getPositionErrorLast (int aWhich) const
 Get the last achieved position error.

void setVelocityErrorLast (double aE0, double aE1=0.0, double aE2=0.0)
 Set the last achieved velocity error.

double getVelocityErrorLast (int aWhich) const
 Get the last achieved velocity error.

double getPositionError (int aWhich) const
 Get the position track error of a specified track goal.

double getVelocityError (int aWhich) const
 Get the velocity track error of a specified track goal.

double getDesiredAcceleration (int aWhich) const
 Get the desired acceleration of a specified track goal.

double getAcceleration (int aWhich) const
 Get the acceleration of a specified track goal.

virtual void computeErrors (double aT)=0
virtual void computeDesiredAccelerations (double aT)=0
virtual void computeAccelerations ()=0
virtual void computeJacobian ()
 Compute the Jacobian.

virtual void computeEffectiveMassMatrix ()
 Compute the effective mass matrix.

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

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

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

void updateData ()
 Update the member data of this object based on its XML node.


Static Public Attributes

const char DEFAULT_NAME [] = "default"

Protected Attributes

rdModel_model
 Model.

bool _on
 Flag to indicate on or off state.

int _wrtBody
 Body with respect to which the track goals are specified.

int _expressBody
 Body frame in which the track goals are expressed.

bool _active [3]
 Flag to specify the active track goals.

double _w [3]
 Weights of the track goals.

double _kp [3]
 Position error feedback gain.

double _kv [3]
 Velocity error feedback gain.

double _ka [3]
 Feedforward acceleration gain.

double _r [3][3]
 Directions of the track goals.

int _nTrk
 Number of track functions.

rdFunction_pTrk [3]
 Position track functions.

rdFunction_vTrk [3]
 Velocity track functions.

rdFunction_aTrk [3]
 Acceleration track functions.

double _pErrLast [3]
 Last position error.

double _pErr [3]
 Position error.

double _vErrLast [3]
 Last velocity error.

double _vErr [3]
 Velocity error.

double _aDes [3]
 Desired accelerations.

double _a [3]
 Accelerations.

double * _j
 Jacobian.

double * _m
 Effective mass matrix.


Private Member Functions

void setNull ()
 Set NULL values for all member variables.

void copyData (const suTrackObject &aTrackObject)
 Copy the member data for this class only.


Static Private Attributes

const char PROP_WRT_BODY [] = "wrt_body"
const char PROP_EXPRESS_BODY [] = "express_body"
const char PROP_ON [] = "on"
const char PROP_ACTIVE [] = "active"
const char PROP_W [] = "weight"
const char PROP_KP [] = "kp"
const char PROP_KV [] = "kv"
const char PROP_KA [] = "ka"
const char PROP_R0 [] = "R0"
const char PROP_R1 [] = "R1"
const char PROP_R2 [] = "R2"

Detailed Description

An abstract base class for specifying an object that is to be tracked during a dynamic simulation.

Author:
Frank C. Anderson, Darryl G. Thelen
Version:
1.0


Constructor & Destructor Documentation

suTrackObject::suTrackObject  ) 
 

Construct a default track object for a specified model.

Parameters:
aModel Model for which tracking is being conducted.

suTrackObject::suTrackObject IDOM_Element *  aElement  ) 
 

Construct a track object from an XML Element.

Parameters:
aModel Model for which tracking is being conducted.
aElement XML element.

suTrackObject::suTrackObject const suTrackObject &  aTrackObject  ) 
 

Copy constructor.

Parameters:
aTrackObject Track object to be copied.


Member Function Documentation

void suTrackObject::copyData const suTrackObject &  aTrackObject  )  [private]
 

Copy the member data for this class only.

Parameters:
aTrackObject Object whose data is to be copied.

void suTrackObject::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.
See also:
rdObject::generateNode()

Reimplemented from rdObject.

Reimplemented in suTrackJoint.

double suTrackObject::getAcceleration int  aWhich  )  const
 

Get the acceleration of a specified track goal.

The acceleration returned is the dot product of the appropriate track-goal direction and the acceleration of the point or orientation in question. In the case of generalized coordinates, the acceleration of the generalized coordinate is returned (i.e., a direction is not appropriate).

For the value returned by this method to be valid, the method computeAccelerations() must be called first.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Acceleration. rdMath::NAN is returned on an error.

bool suTrackObject::getActive int  aWhich  )  const
 

Get whether a specified track goal is active.

Parameters:
aWhich Number of the track goal in question.
Returns:
True if the specified track goal is active, false otherwise.

double suTrackObject::getDesiredAcceleration int  aWhich  )  const
 

Get the desired acceleration of a specified track goal.

The method computeDesiredAccelerations() must be called first for the values returned by this method to be valid.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Desired acceleration. rdMath::NAN is returned on an error.

void suTrackObject::getDirection_0 double  rR[3]  )  const
 

Get the direction of track goal 0.

Parameters:
aR Direction.

void suTrackObject::getDirection_1 double  rR[3]  )  const
 

Get the direction of track goal 1.

Parameters:
aR Direction.

void suTrackObject::getDirection_2 double  rR[3]  )  const
 

Get the direction of track goal 2.

Parameters:
aR Direction.

int suTrackObject::getExpressBody  )  const
 

Get the body in which the track goals are expressed.

Returns:
Body ID.

double suTrackObject::getKA int  aWhich  )  const
 

Get the acceleration gain for a specified track goal.

Parameters:
aWhich Number of the track goal in question.
Returns:
Acceleration gain.

double suTrackObject::getKP int  aWhich  )  const
 

Get the position gain for a specified track goal.

Parameters:
aWhich Number of the track goal in question.
Returns:
Position gain.

double suTrackObject::getKV int  aWhich  )  const
 

Get the velocity gain for a specified track goal.

Parameters:
aWhich Number of the track goal in question.
Returns:
Velocity gain.

rdModel * suTrackObject::getModel  )  const
 

Get the model to which this track object applies.

Returns:
Pointer to the model.

int suTrackObject::getNumTrackFunctions  )  const
 

Get the number of position track functions.

Returns:
Number of position track functions.

bool suTrackObject::getOn  )  const
 

Get whether or not this track object is on.

Returns:
True if on, false if off.

double suTrackObject::getPositionError int  aWhich  )  const
 

Get the position track error of a specified track goal.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Error

double suTrackObject::getPositionErrorLast int  aWhich  )  const
 

Get the last achieved position error.

This information is useful for checking that error dynamics are being followed.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Last position error.

rdFunction * suTrackObject::getTrackFunction int  aWhich  )  const
 

Get a specified track function.

Parameters:
aWhich Specifies which track function (0, 1, or 2).
Returns:
Function.

rdFunction * suTrackObject::getTrackFunctionForAcceleration int  aWhich  )  const
 

Get a specified acceleration track function.

Parameters:
aWhich Specifies which track function (0, 1, or 2).
Returns:
Function.

rdFunction * suTrackObject::getTrackFunctionForVelocity int  aWhich  )  const
 

Get a specified velocity track function.

Parameters:
aWhich Specifies which track function (0, 1, or 2).
Returns:
Function.

double suTrackObject::getVelocityError int  aWhich  )  const
 

Get the velocity track error of a specified track goal.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Error

double suTrackObject::getVelocityErrorLast int  aWhich  )  const
 

Get the last achieved velocity error.

This information is useful for checking that error dynamics are being followed.

Parameters:
aWhich Specifies which track goal (0, 1, or 2).
Returns:
Last velocity error.

double suTrackObject::getWeight int  aWhich  )  const
 

Get the weight of each track goal.

Parameters:
aWhich Number of the track goal in question.
Returns:
Weight.

int suTrackObject::getWRTBody  )  const
 

Get the body with respect to (WRT) which the track goals are specified.

Returns:
Body ID.

suTrackObject & suTrackObject::operator= const suTrackObject &  aTrackObject  ) 
 

Assignment operator.

Returns:
Reference to the altered object.

void suTrackObject::setActive bool  a0,
bool  a1 = false,
bool  a2 = false
 

Set whether or not track goals are active.

Parameters:
a0 Active flag for track goal 0-- true means active.
a1 Active flag for track goal 1-- true means active.
a2 Active flag for track goal 2-- true means active.

void suTrackObject::setDirection_0 const double  aR[3]  ) 
 

Set the direction of track goal 0.

Parameters:
aR Direction. This vector is normalized.

void suTrackObject::setDirection_1 const double  aR[3]  ) 
 

Set the direction of track goal 1.

Parameters:
aR Direction. This vector is normalized.

void suTrackObject::setDirection_2 const double  aR[3]  ) 
 

Set the direction of track goal 2.

Parameters:
aR Direction. This vector is normalized.

void suTrackObject::setExpressBody int  aBody  ) 
 

Set the body in which the track goals are expressed.

Parameters:
aBody Body ID.

void suTrackObject::setKA double  aK0,
double  aK1 = 0.0,
double  aK2 = 0.0
 

Set the acceleration gains for each track goal.

Parameters:
aK0 Gain for track goal 0.
aK1 Gain for track goal 1.
aK2 Gain for track goal 2.

void suTrackObject::setKP double  aK0,
double  aK1 = 0.0,
double  aK2 = 0.0
 

Set the position gains for each track goal.

Parameters:
aK0 Gain for track goal 0.
aK1 Gain for track goal 1.
aK2 Gain for track goal 2.

void suTrackObject::setKV double  aK0,
double  aK1 = 0.0,
double  aK2 = 0.0
 

Set the velocity gains for each track goal.

Parameters:
aK0 Gain for track goal 0.
aK1 Gain for track goal 1.
aK2 Gain for track goal 2.

void suTrackObject::setModel rdModel aModel  ) 
 

Set the model to which this track object applies.

Parameters:
aModel Model.

void suTrackObject::setOn bool  aTrueFalse  ) 
 

Turn this track object on or off.

Parameters:
aTureFalse Turns analysis on if "true" and off if "false".

void suTrackObject::setPositionErrorLast double  aE0,
double  aE1 = 0.0,
double  aE2 = 0.0
 

Set the last achieved position error.

This information is useful for checking that error dynamics are being followed.

Parameters:
aE0 Last position error for track goal 0.
aE1 Last position error for track goal 1.
aE2 Last position error for track goal 2.

void suTrackObject::setTrackFunctions rdFunction aF0,
rdFunction aF1 = NULL,
rdFunction aF2 = NULL
 

Set the track functions.

Note that this method makes copies of the specified track functions, so the caller may use the specified functions for whatever purposes.

Parameters:
aF0 Function for track goal 0.
aF1 Function for track goal 1.
aF2 Function for track goal 2.

void suTrackObject::setTrackFunctionsForAcceleration rdFunction aF0,
rdFunction aF1 = NULL,
rdFunction aF2 = NULL
 

Set the acceleration track functions.

Note that this method makes copies of the specified track functions, so the caller may use the specified functions for whatever purposes.

Parameters:
aF0 Function for track goal 0.
aF1 Function for track goal 1.
aF2 Function for track goal 2.

void suTrackObject::setTrackFunctionsForVelocity rdFunction aF0,
rdFunction aF1 = NULL,
rdFunction aF2 = NULL
 

Set the velocity track functions.

Note that this method makes copies of the specified functions, so the caller may use the specified functions for whatever purposes.

Parameters:
aF0 Function for track goal 0.
aF1 Function for track goal 1.
aF2 Function for track goal 2.

void suTrackObject::setVelocityErrorLast double  aE0,
double  aE1 = 0.0,
double  aE2 = 0.0
 

Set the last achieved velocity error.

This information is useful for checking that error dynamics are being followed.

Parameters:
aE0 Last velocity error for track goal 0.
aE1 Last velocity error for track goal 1.
aE2 Last velocity error for track goal 2.

void suTrackObject::setWeight double  aW0,
double  aW1 = 0.0,
double  aW2 = 0.0
 

Set the weight of each track goal.

Parameters:
aW0 Weight for track goal 0.
aW1 Weight for track goal 1.
aW2 Weight for track goal 2.

void suTrackObject::setWRTBody int  aBody  ) 
 

Set the body with respect to (WRT) which the track goals are specified.

Parameters:
aBody Body ID.

void suTrackObject::updateData  ) 
 

Update the member data of this object based on its XML node.

Member objects (children) are not updated.

Reimplemented in suTrackJoint.

void suTrackObject::updateNode bool  aDeep = true  )  [virtual]
 

Update the XML node representing this object.

Parameters:
aDeep If true, update the XML node of this object AND the XML nodes of all class members that are rdObjects (child nodes); if false, update only the XML node of this object without updating the XML nodes of its children.

Reimplemented from rdObject.

Reimplemented in suTrackJoint.

void suTrackObject::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 rdObject.

Reimplemented in suTrackJoint.


Member Data Documentation

rdFunction* suTrackObject::_aTrk[3] [protected]
 

Acceleration track functions.

If acceleration track functions are not specified, derivatives of the position track function are used.

rdFunction* suTrackObject::_pTrk[3] [protected]
 

Position track functions.

Different types of track objects can require different numbers of track functions. For example, to track a joint angle, only one track function is needed. However, to track a position, up to three track functions may be needed.

rdFunction* suTrackObject::_vTrk[3] [protected]
 

Velocity track functions.

If velocity track functions are not specified, derivatives of the position track function are used.


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