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

rdActuatedModel_SDFast Class Reference

A class that supports actuation and contact functionality to rdSDFast models. More...

#include <rdActuatedModel_SDFast.h>

Inheritance diagram for rdActuatedModel_SDFast:

rdSDFast rdModel cgmalWalking01 rdBlock suBlock suHopper suSlider List of all members.

Public Member Functions

 rdActuatedModel_SDFast (rdActuatorSet *aActuators, rdContactForceSet *aContacts)
 Default constructor.

virtual ~rdActuatedModel_SDFast ()
 Destructor.

const char * getActuatorName (int aIndex) const
 Get the name of an actuator.

const rdActuatorSetgetActuatorSet () const
 Get the actuators for the model.

const rdContactForceSetgetContactForceSet () const
 Get the contact forces for the model.

virtual void setControls (const double aX[])
 Set the current controls for the model.

virtual void setStates (const double aY[])
 Set the current states for this model.

virtual void getStates (double rY[]) const
 Get the current states.

virtual double getState (int aIndex) const
 Get the a state by index.

virtual void setPseudoStates (const double aYP[])
 Set the current pseudo-states for this model.

virtual void getPseudoStates (double rYP[]) const
 Get the current pseudo-states for this model.

virtual double getPseudoState (int aIndex) const
 Get the a pseudo-state by index.

virtual void computeActuation ()
 Compute all quantities associated with actuating a model.

virtual void computeActuatorStateDerivatives (double rDY[])
 Compute time derivatives of all actuator states.

virtual void applyActuatorForce (int aID)
 Apply an actuator force.

virtual void applyActuatorForces ()
 Apply actuator forces.

virtual double getActuatorForce (int aID) const
 Get the magnitude of force experted by a particular actuator.

virtual double getActuatorSpeed (int aID) const
 Get the speed at which a particular actuator force is applied.

virtual double getActuatorPower (int aID) const
 Get the power delivered or absorbed by a particular actuator.

virtual void computeContact ()
 Compute all quantities associated with simulating contact between bodies.

virtual void applyContactForce (int aID)
 Apply a contacted force.

virtual void applyContactForces ()
 Apply the computed contacted forces.

virtual int getContactBodyA (int aID) const
 Get the body number of BodyA for a particular contact force.

virtual int getContactBodyB (int aID) const
 Get the body number of BodyB for a particular contact force.

virtual void setContactPointA (int aID, const double aPoint[3])
 Set the contact point on BodyA expressed in the local frame of BodyA for a specified contact.

virtual void getContactPointA (int aID, double rPoint[3]) const
 Get the contact point on BodyA expressed in the local frame of BodyA for a particular contact.

virtual void setContactPointB (int aID, const double aPoint[3])
 Set the contact point on BodyB expressed in the local frame of BodyB for a specified contact.

virtual void getContactPointB (int aID, double rPoint[3]) const
 Get the contact point on BodyB expressed in the local frame of BodyB for a particular contact.

virtual void getContactForce (int aID, double rF[3]) const
 Get the contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactNormalForce (int aID, double rFP[3], double rFV[3], double rF[3]) const
 Get the normal contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactTangentForce (int aID, double rFP[3], double rFV[3], double rF[3]) const
 Get the tangential contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

virtual void getContactStiffness (int aID, const double aDX[3], double rDF[3]) const
 Get the instantaneous stiffness (or change in force on BodyB due to a change in position of the BodyB contact point) of a specified contact force.

virtual void getContactViscosity (int aID, const double aDV[3], double rDF[3]) const
 Get the instantaneous viscosity (or change in force on BodyB due to a change in velocity of the BodyB contact point) of a specified contact force.

virtual void getContactFrictionCorrection (int aID, double rDFFric[3]) const
 Get the correction that was made to the contact force to enforce friction constraints.

virtual double getContactForce (int aID) const
 Get the magnitude of force experted by a particular contact force.

virtual double getContactSpeed (int aID) const
 Get the speed at which a particular contact force is applied.

virtual double getContactPower (int aID) const
 Get the power delivered or absorbed by a particular contact force.

virtual void promoteControlsToStates (const double aX[], double aDT)
 Promote a set of controls to state variables.

int deriv (double t, double *xt, double *y, double *dy)
 Compute the derivatives of the states.

int deriv (double t, double *xt, double *y, double *dqdt, double *dudt)
 Compute the derivatives of the states.

void integBeginCallback (int i, double dt, double t, double *x, double *y, void *cd=NULL)
 At the beginning of an integration, initialize the decomposition.

void integStepCallback (double *xtPrev, double *yPrev, int i, double dt, double t, double *x, double *y, void *cd=NULL)
 After each integration step, update the horizontal spring zeros and draw the model.


Protected Attributes

rdActuatorSet_actuatorSet
rdContactForceSet_contactSet

Private Member Functions

void setNull ()
 Set NULL values for all the variable members of this class.

void constructControls ()
 Construct and initialize the controls array.

void constructStates ()
 Construct and initialize the state arrays.

void constructPseudoStates ()
 Construct and initialize the array for the initial pseudo-states.

void constructNames ()
 Construct the names of the various components of the model.


Detailed Description

A class that supports actuation and contact functionality to rdSDFast models.


Member Function Documentation

void rdActuatedModel_SDFast::applyContactForce int  aID  )  [virtual]
 

Apply a contacted force.

For the correct contact forces to be applied correctly, computeContact() must be called prior to calling this method.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::applyContactForces  )  [virtual]
 

Apply the computed contacted forces.

For the correct contact forces to be applied correctly, computeContact() must be called prior to calling this method.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::computeContact  )  [virtual]
 

Compute all quantities associated with simulating contact between bodies.

These quantities include at least the contact bodies, contact points, and contact forces.

See also:
getNP()

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getActuatorForce int  aID  )  const [virtual]
 

Get the magnitude of force experted by a particular actuator.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Magnitude of actuator force.

Reimplemented from rdModel.

const char * rdActuatedModel_SDFast::getActuatorName int  aIndex  )  const
 

Get the name of an actuator.

Parameters:
aIndex Index of the actuator whose name is desired. aIndex should be greater than or equal to 0 and less than the number of actuators.
Returns:
Control name.
See also:
getNA()

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getActuatorPower int  aID  )  const [virtual]
 

Get the power delivered or absorbed by a particular actuator.

A positive power means the actuator is doing work on the model; negative power means that the actuator is absorbing energy from the model.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Power delivered (positive) or absorbed (negative).

Reimplemented from rdModel.

const rdActuatorSet * rdActuatedModel_SDFast::getActuatorSet  )  const
 

Get the actuators for the model.

Returns:
Set of actuators.

double rdActuatedModel_SDFast::getActuatorSpeed int  aID  )  const [virtual]
 

Get the speed at which a particular actuator force is applied.

For the returned information to be valid, computeActuation() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Speed at which actuator force is applied.

Reimplemented from rdModel.

int rdActuatedModel_SDFast::getContactBodyA int  aID  )  const [virtual]
 

Get the body number of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Body ID of BodyA.

Reimplemented from rdModel.

int rdActuatedModel_SDFast::getContactBodyB int  aID  )  const [virtual]
 

Get the body number of BodyB for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Body ID of BodyB.

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getContactForce int  aID  )  const [virtual]
 

Get the magnitude of force experted by a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Magnitude of contact force.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactForce int  aID,
double  rF[3]
const [virtual]
 

Get the contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rF Contact force acting on BodyB expressed in the local frame of BodyA.

Reimplemented from rdModel.

const rdContactForceSet * rdActuatedModel_SDFast::getContactForceSet  )  const
 

Get the contact forces for the model.

Returns:
Set of contact forces.

void rdActuatedModel_SDFast::getContactFrictionCorrection int  aID,
double  rDFFric[3]
const [virtual]
 

Get the correction that was made to the contact force to enforce friction constraints.

This correction is returned as the change in contact force applied to BodyB expressed in the local frame of BodyA.

Note that this correction is NOT intended to express changes in contact force due to damping terms, but rather changes due to the enforcement of constraints on the tangential component of the contact force, such as enforcing a coefficient of friction (e.g., fx <= mu*fy).

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rCorrection Change in contact force due to enforcing friction constraints. This correction is returned as the change in contact force applied to BodyA expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactNormalForce int  aID,
double  rFP[3],
double  rFV[3],
double  rF[3]
const [virtual]
 

Get the normal contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rFP Elastic normal contact force NOT corrected to enforce friction constraints.
rFV Viscous normal contact force NOT corrected to enforce friction constraints.
rF Total normal contact force acting on BodyB expressed in the local frame of BodyA. This is the actual normal force applied to BodyB.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactPointA int  aID,
double  rPoint[3]
const [virtual]
 

Get the contact point on BodyA expressed in the local frame of BodyA for a particular contact.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact- should be greater than or equal to zero and less than the value returned by getNP().
rPoint Contact point on BodyA expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactPointB int  aID,
double  rPoint[3]
const [virtual]
 

Get the contact point on BodyB expressed in the local frame of BodyB for a particular contact.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rPoint Contact point on BodyB expressed in the local frame of BodyB.

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getContactPower int  aID  )  const [virtual]
 

Get the power delivered or absorbed by a particular contact force.

A positive power means the contact force is doing work on the model; negative power means that the contact force is absorbing energy from the model.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Power delivered (positive) or absorbed (negative).

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getContactSpeed int  aID  )  const [virtual]
 

Get the speed at which a particular contact force is applied.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
Returns:
Speed at which contact force is applied.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactStiffness int  aID,
const double  aDX[3],
double  rDF[3]
const [virtual]
 

Get the instantaneous stiffness (or change in force on BodyB due to a change in position of the BodyB contact point) of a specified contact force.

aDF = (stiffness) * aDX; stiffness == df/dx (partial of f wrt x)

The displacement (aDX) is assumed to be expressed in the local frame of BodyA and specifies a change in position of the BodyB contact point. If the aDX is a unit vector, the returned value is the stiffness of the contact force in the direction aDX. However, if aDX is not a unit vector, the returned value is the change in force applied to BodyB that would occur for a displacment of aDX.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aDX Displacement of the BodyB contact point expressed in the local frame of BodyA.
rDF Change in force applied to BodyB for the given displacement (or stiffness if |aDX| = 1.0) expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactTangentForce int  aID,
double  rFP[3],
double  rFV[3],
double  rF[3]
const [virtual]
 

Get the tangential contact force acting on BodyB expressed in the local frame of BodyA for a particular contact force.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
rFP Elastic tangential contact force NOT corrected to enforce friction constraints.
rFV Viscous tangential contact force NOT corrected to enforce friction constraints.
rF Total tangential contact force acting on BodyB expressed in the local frame of BodyA. This is the actual tangential force applied to BodyB.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getContactViscosity int  aID,
const double  aDV[3],
double  rDF[3]
const [virtual]
 

Get the instantaneous viscosity (or change in force on BodyB due to a change in velocity of the BodyB contact point) of a specified contact force.

aDF = (viscosity) * aDV; viscosity == df/dv (partial of f wrt v)

The velocity change (aDV) is assumed to be expressed in the local frame of BodyA and specifies a change in velocity of the BodyB contact point. If the aDV is a unit vector, the returned value is the visocity of the contact force in the direction aDV. However, if aDV is not a unit vector, the returned value is the change in force applied to BodyB that would occur for a change in velocity of aDV.

For the returned information to be valid, computeContact() must be called prior to calling this method.

Parameters:
aID Index of the desired contact force- should be greater than or equal to zero and less than the value returned by getNP().
aDV Change in velocity of the BodyB contact point expressed in the local frame of BodyA.
rDF Change in force applied to BodyB for the given velocity change (or viscosity if |aDX| = 1.0) expressed in the local frame of BodyA.

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getPseudoState int  aIndex  )  const [virtual]
 

Get the a pseudo-state by index.

Parameters:
aIndex Array index of the desired state.
Returns:
Value of the pseudo-state. On an error, rdMath::NAN is returned.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::getPseudoStates double  rYP[]  )  const [virtual]
 

Get the current pseudo-states for this model.

Parameters:
aYP Array of pseudo-states. The size of aYP should be the value returned by getNYP().
See also:
rdModel::setPseudoStates();

Reimplemented from rdModel.

double rdActuatedModel_SDFast::getState int  aIndex  )  const [virtual]
 

Get the a state by index.

Parameters:
aIndex Array index of the desired state.
Returns:
Value of the state. On an error, rdMath::NAN is returned.

Implements rdModel.

void rdActuatedModel_SDFast::getStates double  rY[]  )  const [virtual]
 

Get the current states.

Parameters:
aY Array of states. The size of aYP should be the value returned by getNY().
See also:
rdModel::setStates();

Implements rdModel.

void rdActuatedModel_SDFast::promoteControlsToStates const double  aX[],
double  aDT
[virtual]
 

Promote a set of controls to state variables.

This method is normally useful when solving for controls that will optimize some aspect of a model performance. For example, in models in which the controls are neural excitations, but muscle forces are determined by activation level, this method might set the muscle activations equal to the excitations. Each actuator is responsible for knowing how to promote its own controls to states. For static problems, the time step should be set to zero (i.e., aDT=0.0) for dynamic problems, like during a forward dynamic simulation, aDT should be set to an appropriate time step value, like the integration step size.

Parameters:
aX Array of controls.
aDT Time step.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::setContactPointA int  aID,
const double  aPoint[3]
[virtual]
 

Set the contact point on BodyA expressed in the local frame of BodyA for a specified contact.

Parameters:
aID Index of the desired contact- should be greater than or equal to zero and less than the value returned by getNP().
aPoint Contact point on BodyA expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::setContactPointB int  aID,
const double  aPoint[3]
[virtual]
 

Set the contact point on BodyB expressed in the local frame of BodyB for a specified contact.

Parameters:
aID Index of the desired contact- should be greater than or equal to zero and less than the value returned by getNP().
aPoint Contact point on BodyB expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdActuatedModel_SDFast::setControls const double  aX[]  )  [virtual]
 

Set the current controls for the model.

The controls must be set for the model and the actuators.

Parameters:
aX Array of controls. The size of aX should be the value returned by getNX().
See also:
rdModel::setControls();

Reimplemented from rdModel.

void rdActuatedModel_SDFast::setPseudoStates const double  aYP[]  )  [virtual]
 

Set the current pseudo-states for this model.

Parameters:
aYP Array of pseudo-states. The size of aYP should be the value returned by getNYP().
See also:
rdModel::setPseudoStates();

Reimplemented from rdModel.

void rdActuatedModel_SDFast::setStates const double  aY[]  )  [virtual]
 

Set the current states for this model.

This method sets the configuration (coordinates and speeds) of the model and also the states of the actuators.

Parameters:
aY Array of states. The size of aY should be the value returned by getNY().
See also:
rdModel::setStates();

rdModel::setConfiguration().

rdSDFast::setConfiguration().

Implements rdModel.


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