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

rdSDFast Class Reference

A wrapper class that implements many of the methods in rdModel by interfacing with SDFast. More...

#include <rdSDFast.h>

Inheritance diagram for rdSDFast:

rdModel rdActuatedModel_SDFast rdUTWalking8 suShank suSIMM cgmalWalking01 rdBlock suBlock suHopper suSlider suUTWalk8IAHard suUTWalk8IATaylor suUTWalkGenFrc List of all members.

Public Member Functions

 rdSDFast ()
 Default constructor.

virtual ~rdSDFast ()
 Destructor.

virtual void setGravity (double aGrav[3])
 Set the gravity.

virtual void getGravity (double rGrav[3]) const
 Get the gravity.

virtual void setConfiguration (const double aQ[], const double aU[])
 Set the configuration of the model.

virtual void setConfiguration (const double aY[])
 Set the configuration of the model.

virtual int getGroundID () const
 Get the body ID of the ground (or inertial) frame.

virtual void getBodyToJointBodyLocal (int aBody, double rBTJ[3]) const
 Get the vector directed from a body's center of mass to its joint.

virtual void getInboardToJointBodyLocal (int aBody, double rITJ[3]) const
 For a specifited body, get the vector directed from the center of mass of the body's inboard body to the body's joint with the inboard body.

virtual double getMass (int aBody) const
 Get the mass of a body.

virtual int getInertiaBodyLocal (int aBody, double rI[3][3]) const
 Get the scalar inertia matrix of a body.

virtual int getInertiaBodyLocal (int aBody, double *rI) const
 Get the scalar inertia matrix of a body.

virtual void getSystemInertia (double *rM, double rCOM[3], double rI[3][3]) const
 Get the mass, center of mass, and inertia tensor of the whole model.

virtual void getSystemInertia (double *rM, double *rCOM, double *rI) const
 Get the mass, center of mass, and inertia tensor of the whole model.

virtual void getPosition (int aBody, const double aPoint[3], double rPos[3]) const
 Get the inertial position of a point on a body.

virtual void getVelocity (int aBody, const double aPoint[3], double rVel[3]) const
 Get the inertial velocity of a point on a body.

virtual void getAcceleration (int aBody, const double aPoint[3], double rAcc[3]) const
 Get the inertial acceleration of a point on a body.

virtual void getDirectionCosines (int aBody, double rDirCos[3][3]) const
 Get the body orientation with respect to the ground.

virtual void getDirectionCosines (int aBody, double *rDirCos) const
 Get the body orientation with respect to the ground.

virtual void getAngularVelocity (int aBody, double rAngVel[3]) const
 Get the inertial angular velocity of a body in the ground reference frame.

virtual void getAngularVelocityBodyLocal (int aBody, double rAngVel[3]) const
 Get the inertial angular velocity in the local body reference frame.

virtual void getAngularAcceleration (int aBody, double rAngAcc[3]) const
 Get the inertial angular acceleration of a body in the ground reference frame.

virtual void getAngularAccelerationBodyLocal (int aBody, double rAngAcc[3]) const
 Get the inertial angular acceleration in the local body reference frame.

virtual void applyForce (int aBody, const double aPoint[3], const double aForce[3])
 Apply a force expressed in the inertial frame to a point on a body.

virtual void applyForces (int aN, const int aBodies[], const double aPoints[][3], const double aForces[][3])
 Apply a set of forces expressed in the inertial frame to a set of bodies.

virtual void applyForces (int aN, const int aBodies[], const double *aPoints, const double *aForces)
 Apply forces expressed in the inertial frame to points bodies.

virtual void applyForceBodyLocal (int aBody, const double aPoint[3], const double aForce[3])
 Apply a force expressed in the body-local frame to a point on a body.

virtual void applyForcesBodyLocal (int aN, const int aBodies[], const double aPoints[][3], const double aForces[][3])
 Apply a set of forces to a set of bodies.

virtual void applyForcesBodyLocal (int aN, const int aBodies[], const double *aPoints, const double *aForces)
 Apply a set of forces to a set of bodies.

virtual void applyTorque (int aBody, const double aTorque[3])
 Apply a torque expressed in the inertial frame to a body.

virtual void applyTorques (int aN, const int aBodies[], const double aTorques[][3])
 Apply a set of torques expressed in the inertial frame to a set of bodies.

virtual void applyTorques (int aN, const int aBodies[], const double *aTorques)
 Apply a set of torques expressed in the inertial frame to a set of bodies.

virtual void applyTorqueBodyLocal (int aBody, const double aTorque[3])
 Apply a torque expressed in the body-local frame to a body.

virtual void applyTorquesBodyLocal (int aN, const int aBodies[], const double aTorques[][3])
 Apply a set of torques expressed in the body-local frame to a set of bodies.

virtual void applyTorquesBodyLocal (int aN, const int aBodies[], const double *aTorques)
 Apply a set of torques expressed in the body-local frame to a set of bodies.

virtual void applyGeneralizedForce (int aU, double aF)
 Apply a generalized force to a generalized coordinate.

virtual void applyGeneralizedForces (const double aF[])
 Apply generalized forces.

virtual void applyGeneralizedForces (int aN, const int aU[], const double aF[])
 Apply generalized forces.

virtual double getNetAppliedGeneralizedForce (int aU) const
 Get the net applied generalized force.

virtual void computeGeneralizedForces (double aDUDT[], double rF[]) const
 Compute the generalized forces necessary to achieve a set of specified accelerations.

virtual int computeAccelerations (double *dqdt, double *dudt)
 Compute the derivatives of the generalized coordinates and speeds.

virtual void formMassMatrix (double *rI)
 Form the system mass matrix.

virtual void formEulerTransform (int aBody, double *rE) const
 Form the transformation matrix E[3][3] that can be used to express the angular velocity of a body in terms of the time derivatives of the euler angles.

virtual void formJacobianTranslation (int aBody, const double aBodyPoint[3], double *rJ, int aRefBody=-1) const
 Form the full Jacobian matrix (J) for the translation of a point on a body.

virtual void formJacobianOrientation (int aBody, double *rJ0, int aRefBody=-1) const
 Form the full Jacobian matrix (J0) for the orientation of a body.

virtual void formJacobianEuler (int aBody, double *rJE, int aRefBody=-1) const
 Form the full Jacobian matrix (JE) for the orientation of a body expressed in terms of Euler angles.

virtual void transform (int aBody1, const double aVec1[3], int aBody2, double rVec2[3]) const
 Transform a vector from one frame to another.

virtual void convertQuaternionsToAngles (double *aQ, double *rQAng) const
 Convert quaterions to angles.

virtual void convertQuaternionsToAngles (rdStorage *rQStore) const
 For all the generalized coordinates held in a storage object, convert the generalized coordinates expressed in quaternions to Euler angles.

virtual void convertAnglesToQuaternions (double *aQAng, double *rQ) const
 Convert angles to quaterions.

virtual void convertAnglesToQuaternions (rdStorage *rQStore) const
 For all the generalized coordinates held in a storage object, convert the generalized coordinates expressed in Euler angles to quaternions when appropriate.

virtual void convertRadiansToDegrees (double *aQRad, double *rQDeg) const
 Convert the rotational generalized coordinates or speeds from units of radians to units of degrees.

virtual void convertRadiansToDegrees (rdStorage *rQStore) const
 Convert the rotational generalized coordinates or speeds from units of radians to units of degrees for all the state-vectors in an rdStorage object.

virtual void convertDegreesToRadians (double *aQDeg, double *rQRad) const
 Convert the rotational generalized coordinates or speeds from units of degrees to units of radiants.

virtual void convertDegreesToRadians (rdStorage *rQStore) const
 Convert the rotational generalized coordinates or speeds from units of degrees to units of radians for all the state-vectors in an rdStorage object.

virtual void convertAnglesToDirectionCosines (double aE1, double aE2, double aE3, double rDirCos[3][3]) const
 Convert angles to direction cosines.

virtual void convertAnglesToDirectionCosines (double aE1, double aE2, double aE3, double *rDirCos) const
 Convert angles to direction cosines.

virtual void convertDirectionCosinesToAngles (double aDirCos[3][3], double *rE1, double *rE2, double *rE3) const
 Convert direction cosines to angles.

virtual void convertDirectionCosinesToAngles (double *aDirCos, double *rE1, double *rE2, double *rE3) const
 Convert direction cosines to angles.

virtual void convertDirectionCosinesToQuaternions (double aDirCos[3][3], double *rQ1, double *rQ2, double *rQ3, double *rQ4) const
 Convert direction cosines to quaternions.

virtual void convertDirectionCosinesToQuaternions (double *aDirCos, double *rQ1, double *rQ2, double *rQ3, double *rQ4) const
 Convert direction cosines to quaternions.

virtual void convertQuaternionsToDirectionCosines (double aQ1, double aQ2, double aQ3, double aQ4, double rDirCos[3][3]) const
 Convert quaternions to direction cosines.

virtual void convertQuaternionsToDirectionCosines (double aQ1, double aQ2, double aQ3, double aQ4, double *rDirCos) const
 Convert quaternions to direction cosines.


Protected Attributes

int * _u2jMap
 Map from generalized speed (degree of freedom) to joint.

int * _u2aMap
 Map from generalized speed (degree of freedom) to axis.


Static Protected Attributes

const int GROUND = -1
 Body number for ground.


Private Member Functions

void setNull ()
 Set the values of all data members to an appropriate "null" value.

void constructSystemVariables ()
 Construct system variables.

void constructJointAndAxisMaps ()
 Construct maps that provide the joint and axis of a specified degree of freedom.

void constructNames ()
 Construct the names of the model.


Detailed Description

A wrapper class that implements many of the methods in rdModel by interfacing with SDFast.

Author:
Frank C. Anderson, James M. Ziegler
Version:
1.0


Member Function Documentation

void rdSDFast::applyForce int  aBody,
const double  aPoint[3],
const double  aForce[3]
[virtual]
 

Apply a force expressed in the inertial frame to a point on a body.

Parameters:
aBody Body ID.
aPoint Point on the body expressed in the body-local frame.
aForce Force applied to the body expressed in the inertial frame.

Implements rdModel.

void rdSDFast::applyForceBodyLocal int  aBody,
const double  aPoint[3],
const double  aForce[3]
[virtual]
 

Apply a force expressed in the body-local frame to a point on a body.

Parameters:
aBody Body ID.
aPoint Point on the body expressed in the body-local frame.
aForce Force applied to the body expressed in the body-local frame.

Implements rdModel.

void rdSDFast::applyForces int  aN,
const int  aBodies[],
const double *  aPoints,
const double *  aForces
[virtual]
 

Apply forces expressed in the inertial frame to points bodies.

Parameters:
aN Number of applied forces.
aBodes Array of body ID's.
aPoints Pointer to a sequence of points expressed in the body-local frame laid out as aPoints[aN][3].
aForces Pointer to a sequence of forces expressed in the inertial frame laid out as aForces[aN][3].

Implements rdModel.

void rdSDFast::applyForces int  aN,
const int  aBodies[],
const double  aPoints[][3],
const double  aForces[][3]
[virtual]
 

Apply a set of forces expressed in the inertial frame to a set of bodies.

The body points, aPoint, should be expressed in the body-local frame. The forces, aForce, should be expressed in the inertial frame.

Parameters:
aN Number of applied forces.
aBodies Array of body ID's.
aPoints Pointer to a sequence of points expressed in the body-local frame laid out as aPoints[aN][3].
aForces Pointer to a sequence of forces expressed in the inertial frame laid out as aForces[aN][3].

Implements rdModel.

void rdSDFast::applyForcesBodyLocal int  aN,
const int  aBodies[],
const double *  aPoints,
const double *  aForces
[virtual]
 

Apply a set of forces to a set of bodies.

Parameters:
aN Number of Forces.
aBody Array of Body ID's.
aPoint Array of points on the bodies expressed in the body-local frames.
aForce Array of forces applied to the body expressed in the body-local frames.

Implements rdModel.

void rdSDFast::applyForcesBodyLocal int  aN,
const int  aBodies[],
const double  aPoints[][3],
const double  aForces[][3]
[virtual]
 

Apply a set of forces to a set of bodies.

Parameters:
aN Number of Forces.
aBody Array of Body ID's.
aPoint Array of points on the bodies expressed in the body-local frames.
aForce Array of forces applied to the body expressed in the body-local frames.

Implements rdModel.

void rdSDFast::applyGeneralizedForce int  aU,
double  aF
[virtual]
 

Apply a generalized force to a generalized coordinate.

Note that depending on the axis type the generalized force can be a torque or a force.

Parameters:
aU Generalized coordinate.
aF Applied force.

Implements rdModel.

void rdSDFast::applyGeneralizedForces int  aN,
const int  aU[],
const double  aF[]
[virtual]
 

Apply generalized forces.

The dimension of aF is assumed to be the number of generalized speeds.

Parameters:
aN Number of generalized forces.
aU Generalized coordinate.
aF Applied force.

Implements rdModel.

void rdSDFast::applyGeneralizedForces const double  aF[]  )  [virtual]
 

Apply generalized forces.

The dimension of aF is assumed to be the number of generalized speeds.

Parameters:
aF Applied force.

Implements rdModel.

void rdSDFast::applyTorque int  aBody,
const double  aTorque[3]
[virtual]
 

Apply a torque expressed in the inertial frame to a body.

Parameters:
aBody Body ID.
aTorque Torque expressed in the inertial frame.

Implements rdModel.

void rdSDFast::applyTorqueBodyLocal int  aBody,
const double  aTorque[3]
[virtual]
 

Apply a torque expressed in the body-local frame to a body.

Parameters:
aBody Body ID.
aTorque Torque expressed in the body-local frame.

Implements rdModel.

void rdSDFast::applyTorques int  aN,
const int  aBodies[],
const double *  aTorques
[virtual]
 

Apply a set of torques expressed in the inertial frame to a set of bodies.

Parameters:
aN Number of Torques.
aBody Array of Body ID's.
aTorques Array of torques applied to the body expressed the inertial frame.

Implements rdModel.

void rdSDFast::applyTorques int  aN,
const int  aBodies[],
const double  aTorques[][3]
[virtual]
 

Apply a set of torques expressed in the inertial frame to a set of bodies.

Parameters:
aN Number of Torques.
aBody Array of Body ID's.
aTorques Array of torques applied to the body expressed the inertial frame.

Implements rdModel.

void rdSDFast::applyTorquesBodyLocal int  aN,
const int  aBodies[],
const double *  aTorques
[virtual]
 

Apply a set of torques expressed in the body-local frame to a set of bodies.

Parameters:
aN Number of Torques.
aBody Array of Body ID's.
aTorques Array of torques applied to the body expressed the body-local frame.

Implements rdModel.

void rdSDFast::applyTorquesBodyLocal int  aN,
const int  aBodies[],
const double  aTorques[][3]
[virtual]
 

Apply a set of torques expressed in the body-local frame to a set of bodies.

Parameters:
aN Number of Torques.
aBody Array of Body ID's.
aTorques Array of torques applied to the body expressed the body-local frame.

Implements rdModel.

int rdSDFast::computeAccelerations double *  dqdt,
double *  dudt
[virtual]
 

Compute the derivatives of the generalized coordinates and speeds.

Parameters:
dqdt Derivatives of generalized coordinates.
dudt Derivatives of generalized speeds.

Implements rdModel.

void rdSDFast::computeGeneralizedForces double  aDUDT[],
double  rF[]
const [virtual]
 

Compute the generalized forces necessary to achieve a set of specified accelerations.

If any forces have been applied to the model, the balance of generalized forces needed to achieve the desired accelerations is computed. Note that constraints are not taken into account by this method.

Parameters:
aDUDT Array of desired accelerations of the generalized coordinates- should be dimensioned to NU (see getNU()).
rF Array of generalized forces that will achieve aDUDT without enforcing any constraints- should be dimensioned to NU (see getNU()).

Implements rdModel.

int rdSDFast::constructJointAndAxisMaps  )  [private]
 

Construct maps that provide the joint and axis of a specified degree of freedom.

Returns:
-1 on an error, 0 otherwise.

void rdSDFast::constructSystemVariables  )  [private]
 

Construct system variables.

The following numbers are initialized by making SD/Fast calls: _nb Number of bodies. _nj Number of joints. _nu Number of degrees of freedom. _nq Number of generalized coordinates (_nu + number of ball joints).

Memory allocations are performed for the following data members: _q _u

Returns:
-1 on an error, 0 otherwise.

void rdSDFast::convertAnglesToDirectionCosines double  aE1,
double  aE2,
double  aE3,
double *  rDirCos
const [virtual]
 

Convert angles to direction cosines.

Parameters:
aE1 1st Euler angle.
aE2 2nd Euler angle.
aE3 3rd Euler angle.
rDirCos Vector of direction cosines.

Implements rdModel.

void rdSDFast::convertAnglesToDirectionCosines double  aE1,
double  aE2,
double  aE3,
double  rDirCos[3][3]
const [virtual]
 

Convert angles to direction cosines.

Parameters:
aE1 1st Euler angle.
aE2 2nd Euler angle.
aE3 3rd Euler angle.
rDirCos Vector of direction cosines.

Implements rdModel.

void rdSDFast::convertAnglesToQuaternions rdStorage rQStore  )  const [virtual]
 

For all the generalized coordinates held in a storage object, convert the generalized coordinates expressed in Euler angles to quaternions when appropriate.

Parameters:
rQStore Storage object of generalized coordinates that has all angles expressed as Euler angles in radians. The length of each state-vector in rQStore must be at least getNU().

Implements rdModel.

void rdSDFast::convertAnglesToQuaternions double *  aQAng,
double *  rQ
const [virtual]
 

Convert angles to quaterions.

Parameters:
aQAng Array of generalized coordinates expressed in Euler angles. The length of aQAng must be at least getNU().
rQ Vector of equivalent quaternions.

Implements rdModel.

void rdSDFast::convertDegreesToRadians rdStorage rQStore  )  const [virtual]
 

Convert the rotational generalized coordinates or speeds from units of degrees to units of radians for all the state-vectors in an rdStorage object.

It is assumed that the first first getNU() elements of each state-vector held in the rdStorage object are the generalized coordinates or speeds.

Parameters:
rQStore Storage object.

Implements rdModel.

void rdSDFast::convertDegreesToRadians double *  aQDeg,
double *  rQRad
const [virtual]
 

Convert the rotational generalized coordinates or speeds from units of degrees to units of radiants.

Parameters:
aQDeg Array in degrees. The length of aQDeg should be at least the number of generalized speeds (
See also:
getNU()).
Parameters:
rQRad Array in radians. The length of rQRad should be at least the number of generalized speeds (
See also:
getNU()).

Implements rdModel.

void rdSDFast::convertDirectionCosinesToAngles double *  aDirCos,
double *  rE1,
double *  rE2,
double *  rE3
const [virtual]
 

Convert direction cosines to angles.

Parameters:
aDirCos Vector of direction cosines.
rE1 1st Euler angle.
rE2 2nd Euler angle.
rE3 3rd Euler angle.

Implements rdModel.

void rdSDFast::convertDirectionCosinesToAngles double  aDirCos[3][3],
double *  rE1,
double *  rE2,
double *  rE3
const [virtual]
 

Convert direction cosines to angles.

Parameters:
aDirCos Vector of direction cosines.
rE1 1st Euler angle.
rE2 2nd Euler angle.
rE3 3rd Euler angle.

Implements rdModel.

void rdSDFast::convertDirectionCosinesToQuaternions double *  aDirCos,
double *  rQ1,
double *  rQ2,
double *  rQ3,
double *  rQ4
const [virtual]
 

Convert direction cosines to quaternions.

Parameters:
aDirCos Vector of direction cosines.
rQ1 1st Quaternion.
rQ2 2nd Quaternion.
rQ3 3rd Quaternion.
rQ4 4th Quaternion.

Implements rdModel.

void rdSDFast::convertDirectionCosinesToQuaternions double  aDirCos[3][3],
double *  rQ1,
double *  rQ2,
double *  rQ3,
double *  rQ4
const [virtual]
 

Convert direction cosines to quaternions.

Parameters:
aDirCos Vector of direction cosines.
rQ1 1st Quaternion.
rQ2 2nd Quaternion.
rQ3 3rd Quaternion.
rQ4 4th Quaternion.

Implements rdModel.

void rdSDFast::convertQuaternionsToAngles rdStorage rQStore  )  const [virtual]
 

For all the generalized coordinates held in a storage object, convert the generalized coordinates expressed in quaternions to Euler angles.

Parameters:
rQStore Storage object of generalized coordinates, some of which may be quaternions. The length of each state-vector in rQStore must be at least getNQ().

Implements rdModel.

void rdSDFast::convertQuaternionsToAngles double *  aQ,
double *  rQAng
const [virtual]
 

Convert quaterions to angles.

Parameters:
aQ Array of generalized coordinates, some of which may be quaternions. The length of aQ must be at least getNQ().
rQAng Array of equivalent angles.

Implements rdModel.

void rdSDFast::convertQuaternionsToDirectionCosines double  aQ1,
double  aQ2,
double  aQ3,
double  aQ4,
double *  rDirCos
const [virtual]
 

Convert quaternions to direction cosines.

Parameters:
aQ1 1st Quaternion.
aQ2 2nd Quaternion.
aQ3 3rd Quaternion.
aQ4 4th Quaternion.
rDirCos Vector of direction cosines.

Implements rdModel.

void rdSDFast::convertQuaternionsToDirectionCosines double  aQ1,
double  aQ2,
double  aQ3,
double  aQ4,
double  rDirCos[3][3]
const [virtual]
 

Convert quaternions to direction cosines.

Parameters:
aQ1 1st Quaternion.
aQ2 2nd Quaternion.
aQ3 3rd Quaternion.
aQ4 4th Quaternion.
rDirCos Vector of direction cosines.

Implements rdModel.

void rdSDFast::convertRadiansToDegrees rdStorage rQStore  )  const [virtual]
 

Convert the rotational generalized coordinates or speeds from units of radians to units of degrees for all the state-vectors in an rdStorage object.

It is assumed that the first first getNU() elements of each state-vector held in the rdStorage object are the generalized coordinates or speeds.

Parameters:
rQStore Storage object.

Implements rdModel.

void rdSDFast::convertRadiansToDegrees double *  aQRad,
double *  rQDeg
const [virtual]
 

Convert the rotational generalized coordinates or speeds from units of radians to units of degrees.

Parameters:
aQRad Array in radians. The length of aQRad should be at least the number of generalized speeds (
See also:
getNU()).
Parameters:
rQDeg Array in degrees. The length of rQRad should be at least the number of generalized speeds (
See also:
getNU()).

Implements rdModel.

void rdSDFast::formEulerTransform int  aBody,
double *  rE
const [virtual]
 

Form the transformation matrix E[3][3] that can be used to express the angular velocity of a body in terms of the time derivatives of the euler angles.

The Euler angle convention is body-fixed 1-2-3.

Parameters:
aBody Body ID.
rE Euler angles.

Implements rdModel.

void rdSDFast::formJacobianEuler int  aBody,
double *  rJE,
int  aRefBody = -1
const [virtual]
 

Form the full Jacobian matrix (JE) for the orientation of a body expressed in terms of Euler angles.

JE is laid out as follows: dEx/dq1 dEx/dq2 dEx/dq3 ... dEx/dqnu dEy/dq1 dEy/dq2 dEy/dq3 ... dEy/dqnu dEz/dq1 dEz/dq2 dEz/dq3 ... dEz/dqnu where E is the orientation of the body using 1-2-3 body-fixed Euler angles.

So, JE should have 3 rows and NU columns. In memory, the column index increments fastest, so the representation is JE[3][NU].

It is assumed that enough space has been allocated at rJO to hold all of the Jacobian elements.

The Jacobian elements can be expressed in terms of the ground frame or a particular body frame. By default, the elements are expressed in the ground frame.

Parameters:
aBody Body whose orientation Jacobian is desired.
rJE Euler Jacobian.
aRefBody Body frame in which to express the Jacobian elements. aRefBody has a default value of -1, which results in the Jacobian elements being expressed in the ground frame.

Implements rdModel.

void rdSDFast::formJacobianOrientation int  aBody,
double *  rJ0,
int  aRefBody = -1
const [virtual]
 

Form the full Jacobian matrix (J0) for the orientation of a body.

Note that J0 is not appropriate for operations when the body orientation is specified in terms of Euler angles. When the body is described in terms of Euler angles, the method formJacobianEuler should be used.

J0 is laid out as follows: dOx/dq1 dOx/dq2 dOx/dq3 ... dOx/dqnu dOy/dq1 dOy/dq2 dOy/dq3 ... dOy/dqnu dOz/dq1 dOz/dq2 dOz/dq3 ... dOz/dqnu where O is the orientation of the body.

So, JO should have 3 rows and NU columns. In memory, the column index increments fastest, so the representation is JO[3][NU].

It is assumed that enough space has been allocated at rJO to hold all of the Jacobian elements.

The Jacobian elements can be expressed in terms of the ground frame or a particular body frame. By default, the elements are expressed in the ground frame.

Parameters:
aBody Body whose orientation Jacobian is desired.
rJO Orientation Jacobian.
aRefBody Body frame in which to express the Jacobian elements. aRefBody has a default value of -1, which results in the Jacobian elements being expressed in the ground frame.

Implements rdModel.

void rdSDFast::formJacobianTranslation int  aBody,
const double  aBodyPoint[3],
double *  rJ,
int  aRefBody = -1
const [virtual]
 

Form the full Jacobian matrix (J) for the translation of a point on a body.

J is laid out as follows: dPx/dq1 dPx/dq2 dPx/dq3 ... dPx/dqnu dPy/dq1 dPy/dq2 dPy/dq3 ... dPy/dqnu dPz/dq1 dPz/dq2 dPz/dq3 ... dPz/dqnu where P is the point on the body.

So, J should have 3 rows and NU columns. In memory, the column index increments fastest, so the representation is J[3][NU].

It is assumed that enough space has been allocated at aJ to hold all of the Jacobian elements.

The Jacobian elements can be expressed in terms of the ground frame or a particular body frame. By default, the elements are expressed in the ground frame.

Parameters:
aBody Body on which the point resides.
aPoint Point position expressed in the local frame of body aBody.
rJ Jacobian of point aPoint.
aRefBody Body frame with respect to which the Jacobian elements are expressed. aRefBody has a default value of -1, which results in the Jacobian elements being expressed in the ground frame.

Implements rdModel.

void rdSDFast::formMassMatrix double *  rI  )  [virtual]
 

Form the system mass matrix.

Parameters:
rI Mass matrix (a square matrix of size NU*NU).

Implements rdModel.

void rdSDFast::getAcceleration int  aBody,
const double  aPoint[3],
double  rAcc[3]
const [virtual]
 

Get the inertial acceleration of a point on a body.

Note that the configuration of the model must be set and accelerations of the generalized coordinates must be computed before calling this method.

Parameters:
aBody Body ID.
aPoint Point on the body expressed in the body-local frame.
rAcc Acceleration of the point in the inertial frame.
See also:
set()

computeAccelerations()

Implements rdModel.

void rdSDFast::getAngularAcceleration int  aBody,
double  rAngAcc[3]
const [virtual]
 

Get the inertial angular acceleration of a body in the ground reference frame.

Parameters:
aBody Body ID.
rAngAcc Angular acceleration of the body.

Implements rdModel.

void rdSDFast::getAngularAccelerationBodyLocal int  aBody,
double  rAngAcc[3]
const [virtual]
 

Get the inertial angular acceleration in the local body reference frame.

Parameters:
aBody Body ID.
rAngAcc Angular acceleration of the body.

Implements rdModel.

void rdSDFast::getAngularVelocity int  aBody,
double  rAngVel[3]
const [virtual]
 

Get the inertial angular velocity of a body in the ground reference frame.

Parameters:
aBody Body ID.
rAngVel Angular velocity of the body.

Implements rdModel.

void rdSDFast::getAngularVelocityBodyLocal int  aBody,
double  rAngVel[3]
const [virtual]
 

Get the inertial angular velocity in the local body reference frame.

Parameters:
aBody Body ID.
rAngVel Angular velocity of the body.

Implements rdModel.

void rdSDFast::getBodyToJointBodyLocal int  aBody,
double  rBTJ[3]
const [virtual]
 

Get the vector directed from a body's center of mass to its joint.

The body's joint is always the joint that that body has with its inboard body.

Parameters:
aBody Body ID.
rBTJ Vector from the center of mass of the body to its joint with its inboard body. This vector is expressed in the local frame of aBody.

Implements rdModel.

void rdSDFast::getDirectionCosines int  aBody,
double *  rDirCos
const [virtual]
 

Get the body orientation with respect to the ground.

Parameters:
aBody Body ID.
rDirCos Orientation of the body with respect to the ground frame.

Implements rdModel.

void rdSDFast::getDirectionCosines int  aBody,
double  rDirCos[3][3]
const [virtual]
 

Get the body orientation with respect to the ground.

Parameters:
aBody Body ID.
rDirCos Orientation of the body with respect to the ground frame.

Implements rdModel.

void rdSDFast::getGravity double  rGrav[3]  )  const [virtual]
 

Get the gravity.

Parameters:
rG Gravity vector.

Reimplemented from rdModel.

void rdSDFast::getInboardToJointBodyLocal int  aBody,
double  rITJ[3]
const [virtual]
 

For a specifited body, get the vector directed from the center of mass of the body's inboard body to the body's joint with the inboard body.

Parameters:
aBody Body ID.
rBTJ Vector from the center of mass of the body's inboard body to its joint with the body's inboard body. This vector is expressed in the local frame of the inboard body.

Implements rdModel.

int rdSDFast::getInertiaBodyLocal int  aBody,
double *  rI
const [virtual]
 

Get the scalar inertia matrix of a body.

Parameters:
aBody Body ID.
rI Inertia matrix expressed in terms of body-local coordinates.
Returns:
-1 on an error, 0 otherwise.

Implements rdModel.

int rdSDFast::getInertiaBodyLocal int  aBody,
double  rI[3][3]
const [virtual]
 

Get the scalar inertia matrix of a body.

Parameters:
aBody Body ID.
rI Inertia matrix expressed in terms of body-local coordinates.
Returns:
-1 on an error, 0 otherwise.

Implements rdModel.

double rdSDFast::getMass int  aBody  )  const [virtual]
 

Get the mass of a body.

Parameters:
aBody Body ID.
Returns:
Body mass

Implements rdModel.

double rdSDFast::getNetAppliedGeneralizedForce int  aU  )  const [virtual]
 

Get the net applied generalized force.

The returned force is the sum of all applied forces plus any forces needed for any prescribed motions. The methods setState() (or equivalent) and computeAccelerations() must be called prior to calling this method for the returned result to be valid.

Parameters:
aU Generalized speed (degree of freedom).
Returns:
Net applied force/torque at degree of freedom indexed by aU.

Implements rdModel.

void rdSDFast::getPosition int  aBody,
const double  aPoint[3],
double  rPos[3]
const [virtual]
 

Get the inertial position of a point on a body.

Note that the configuration of the model must be set before calling this method.

Parameters:
aBody Body ID.
aPoint Point on the body expressed in the body-local frame.
rPos Position of the point in the inertial frame.
See also:
setConfiguration()

Implements rdModel.

void rdSDFast::getSystemInertia double *  rM,
double *  rCOM,
double *  rI
const [virtual]
 

Get the mass, center of mass, and inertia tensor of the whole model.

Parameters:
rM System mass.
rCOM System center of mass.
rI System inertia tensor.

Implements rdModel.

void rdSDFast::getSystemInertia double *  rM,
double  rCOM[3],
double  rI[3][3]
const [virtual]
 

Get the mass, center of mass, and inertia tensor of the whole model.

Parameters:
rM System mass.
rCOM System center of mass.
rI System inertia tensor.

Implements rdModel.

void rdSDFast::getVelocity int  aBody,
const double  aPoint[3],
double  rVel[3]
const [virtual]
 

Get the inertial velocity of a point on a body.

Note that the configuration of the model must be set before calling this method.

Parameters:
aBody Body ID.
aPoint Point on the body expressed in the body-local frame.
rVel Velocity of the point in the inertial frame.
See also:
setConfiguration()

Implements rdModel.

void rdSDFast::setConfiguration const double  aY[]  )  [virtual]
 

Set the configuration of the model.

Parameters:
aY Statevector.

Reimplemented from rdModel.

void rdSDFast::setConfiguration const double  aQ[],
const double  aU[]
[virtual]
 

Set the configuration of the model.

Parameters:
aQ Generalized coordinates.
aU Generalized speeds.
Todo:
Should the states (y) be set when q and u are set?

Reimplemented from rdModel.

void rdSDFast::setGravity double  aGrav[3]  )  [virtual]
 

Set the gravity.

Parameters:
aG Gravity vector.

Reimplemented from rdModel.

void rdSDFast::transform int  aBody1,
const double  aVec1[3],
int  aBody2,
double  rVec2[3]
const [virtual]
 

Transform a vector from one frame to another.

Parameters:
aBody1 ID of the body in which the vector is originally defined.
aVec1 Vector to be transformed.
aBody2 ID of the body in which the new vector will be defined.
rVec2 Vector coordinates after transformation.

Implements rdModel.


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