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

rdUTWalking8 Class Reference

A class which represents a point mass free to move in one dimension. More...

#include <rdUTWalking8.h>

Inheritance diagram for rdUTWalking8:

rdSDFast rdModel suUTWalk8IAHard suUTWalk8IATaylor suUTWalkGenFrc List of all members.

Public Member Functions

 rdUTWalking8 ()
 Default constructor.

virtual ~rdUTWalking8 ()
 Destructor.

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

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

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

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

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

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

void setFOM (int aMuscle, double aFOM)
 Set the maximum isometric strength.

double getFOM (int aMuscle) const
 Get the maximum isometric strength.

void setTRise (double aT)
 Set the rise time of muscle activation.

double getTRise () const
 Get the rise time of muscle activation.

void setTFall (double aT)
 Set the fall time of muscle activation.

double getTFall () const
 Get the fall time of muscle activation.

void setStore (bool aTrueFalse)
 Turn on or off whether the model stores simulation data.

bool getStore ()
 Turn on or off whether the model stores simulation data.

void setDraw (bool aTrueFalse)
 Set whether or not to draw the model.

bool getDraw ()
 Get whether or not the model is set to be drawn.

virtual void computeActuation ()
 Bring all quantities associate with actuting the model to a valid internal state.

virtual void computeMuscleForces ()
 Compute the muscle forces.

virtual void computeLigamentTorques ()
 Compute the ligament torques.

virtual void computeLigamentTorques (double *qang, double *u, double *trq)
 Compute ligament torques.

virtual void applyActuatorForce (int aID)
 Apply a particular actuator force to the model.

virtual void applyActuatorForces ()
 Apply all actuator forces to the model.

virtual void setActuatorForce (int aID, double aForce)
 Set the magnitude of force experted by a particular actuator.

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.

void setAllowLeftContact (bool aTrueFalse)
 Set whether or not to allow left-foot contact forces.

bool getAllowLeftContact () const
 Get whether or not to allow left-foot contact forces.

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

virtual void computeSpringPointKinematics (double aVel[][3], double aPos[][3])
 Compute spring point positions and velocities in the inertial frame.

virtual void computeGroundForces (const double aVel[][3], const double aPos[][3], double aFrc[][3])
 Compute ground forces given the current position and velocity of the spring points.

virtual void limitGroundForces (double aFrc[][3])
 Limit the horizontal ground forces so as to model friction.

virtual void updateGroundZeros (double svel[][3], double spos[][3], double sfrc[][3])
 Update the ground spring zeros in the horizontal plane.

virtual void setGroundZerosToCurrentPosition (double t, double *y)
 Set ground zeros to current positions of the springs.

virtual void computeResultantBodyForces (double aFE[][3], double aFB[][6])
 Compute the resultant forces and moments applied by the springs to the 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 rPoint[3])
 Set the contact point on BodyA expressed in the local frame of BodyA for a particular contact force.

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 force.

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

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 force.

virtual void getContactForce (int aID, double rForce[3]) const
 Get the 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 of a particular contact force expressed in the local frame of BodyA.

virtual void getContactViscosity (int aID, const double aDV[3], double rDF[3]) const
 Get the instantaneous viscosity of a particular contact force expressed in the local frame of BodyA.

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 int deriv (double t, double *xt, double *y, double *dy)
 Compute the derivatives of the states.

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

void promoteControlsToStates (const double aX[], double aDT)
 Promote the controls to states.

int draw (double t, double *x, double *y)
 Draw the model.

int draw (double t, double *x, double *y, double *sfrc, double *spnt)
 Draw the model.

void setMuson (int aMus, int aOnOff)
 Set which muscles are drawn.

virtual void integBeginCallback (int i, double dt, double t, double *x, double *y, void *cd=NULL)
 Take care of any initializations needed before an integration.

virtual void integStepCallback (double *xPrev, 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.


Public Attributes

double _tFinal
double _tcRise
double _tcFall
double _jdamp
int _sBodies [rdUTWalking8_NS]
double _sPoints [rdUTWalking8_NS][3]

Static Public Attributes

const int NQ = rdUTWalking8_NQ
const int NU = rdUTWalking8_NU
const int NB = rdUTWalking8_NB
const int NJ = rdUTWalking8_NJ
const int NX = rdUTWalking8_NX
const int NA = rdUTWalking8_NA
const int NY = rdUTWalking8_NY
const int NYP = rdUTWalking8_NYP
const int NS = rdUTWalking8_NS
const int NN = rdUTWalking8_NN
const int NI = NY - (NQ+NU+NX+NX)
const int IMSF = NQ+NU
const int IATV = NQ+NU+NX
const int IINT = NQ+NU+NX+NX
const int LIGU [] = { 6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 }
const int LIGJOINT [] = { 2,2,2,3,3,3,4,5,5,6,7,7,7,8,9,9,10 }
const int LIGAXIS [] = { 1,2,3,1,2,3,1,1,2,1,1,2,3,1,1,2,1 }
const double theta1 []
const double theta2 []
const double k0lig []
const double k1lig1 []
const double k2lig1 []
const double k1lig2 []
const double k2lig2 []
const double MU = 0.7
const double SKV = 1.0e3
const double SKP = 6.9e4
const double E0 = 6.5905e-3
const double E1 = 0.5336322
const double E2 = -1150.8002
const double G0 = 0.02
const double G1 = 10.0
const double G2 = 500.0
const int SBODY [] = { 4,4,4,4,5,8,8,8,8,9 }
const double SBODYPNT [][3]

Protected Member Functions

void initializeParameters ()
 Initialize parameters.

void initializeInitialStates ()
 Initialize the initial states.

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

void setSpringZeros ()
virtual void applyMuscleForces ()
 Apply the muscle forces to the skeleton and compute actuator lengths and shortening velocities.

virtual void applyLigamentTorque (int aID=-1)
 Apply a ligament torque.


Protected Attributes

bool _draw
 Whether or not to draw the model.

bool _allowLeftContact
 Allow the left foot to contact the ground.

int _nn
 Number of control nodes.

double * _ynode
 States stored at the node times.

double * _y
 States.

double * _yp
 Pseudo-states.

double * _tqlig
 Ligament torques.

double * _actlen
 Actuator lengths.

double * _actsv
 Actuator shortening velocities.

double _spos [rdUTWalking8_NS][3]
 Spring positions.

double _svel [rdUTWalking8_NS][3]
 Spring velocities.

double _sfrc [rdUTWalking8_NS][3]
 Spring forces.

bool _store

Detailed Description

A class which represents a point mass free to move in one dimension.


Member Function Documentation

void rdUTWalking8::applyActuatorForce int  aID  )  [virtual]
 

Apply a particular actuator force to the model.

Parameters:
aI The index of the actuator force to apply.

Reimplemented from rdModel.

Reimplemented in suUTWalkGenFrc.

void rdUTWalking8::applyActuatorForces  )  [virtual]
 

Apply all actuator forces to the model.

Actuator forces include muscle forces and ligament torques.

Reimplemented from rdModel.

Reimplemented in suUTWalkGenFrc.

void rdUTWalking8::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 rdUTWalking8::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 rdUTWalking8::applyLigamentTorque int  aID = -1  )  [protected, virtual]
 

Apply a ligament torque.

Parameters:
ID of the ligament torque to apply- should be between 0 and 16. If aID is negative, all ligament torques are applied.

void rdUTWalking8::computeGroundForces const double  aVel[][3],
const double  aPos[][3],
double  aFrc[][3]
[virtual]
 

Compute ground forces given the current position and velocity of the spring points.

Note that horizontal forces are NOT limited in this method. IF friction is being modeled, limitGroundForces() and updateGroundZeros() must be called.

void rdUTWalking8::computeResultantBodyForces double  aFE[][3],
double  aFB[][6]
[virtual]
 

Compute the resultant forces and moments applied by the springs to the bodies.

Note that this method requires that the configuration of the body has been set so that the inertial positions of the spring points can be computed.

int rdUTWalking8::deriv double  t,
double *  xt,
double *  y,
double *  dqdt,
double *  dudt
[virtual]
 

Compute the derivatives of the states.

Note that the accelerations returned by this method are in real time!

Implements rdModel.

Reimplemented in suUTWalkGenFrc.

double rdUTWalking8::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 actuator- should be greater than or equal to zero and less than the value returned by getNA().
Returns:
Magnitude of actuator force.

Reimplemented from rdModel.

Reimplemented in suUTWalkGenFrc.

double rdUTWalking8::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.

Reimplemented in suUTWalkGenFrc.

double rdUTWalking8::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.

Reimplemented in suUTWalkGenFrc.

bool rdUTWalking8::getAllowLeftContact  )  const
 

Get whether or not to allow left-foot contact forces.

Returns:
True if left-foot contact forces are allowed; false otherwise.

int rdUTWalking8::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 rdUTWalking8::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 rdUTWalking8::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 rdUTWalking8::getContactForce int  aID,
double  rForce[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().
rForce Contact force acting on BodyA expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdUTWalking8::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 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().
rPoint Contact point on BodyA expressed in the local frame of BodyA.

Reimplemented from rdModel.

void rdUTWalking8::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 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().
rPoint Contact point on BodyB expressed in the local frame of BodyB.

Reimplemented from rdModel.

double rdUTWalking8::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 rdUTWalking8::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 rdUTWalking8::getContactStiffness int  aID,
const double  aDX[3],
double  rDF[3]
const [virtual]
 

Get the instantaneous stiffness of a particular contact force expressed in the local frame of BodyA.

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().
rStiffness Stiffness expressed in the local frame of BodyA.

Reimplemented from rdModel.

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

Get the instantaneous viscosity of a particular contact force expressed in the local frame of BodyA.

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().
rViscosity Viscosity expressed in the local frame of BodyA.

Reimplemented from rdModel.

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

Get the current value of a pseudo-state by index.

The pseudo-states for this model are the horizontal spring zeros. The fist 10 are the spring zeros in the X direction; the second 10 are the spring zeros in the Z direction.

Parameters:
aIndex Index of the pseudo-state: 0 <= aIndex < getNYP().
Returns:
Value of the pseudo-state. rdMath::NAN is returned on an error.
See also:
getPseudoStates(double rYP[])

getPseudoState(const char* aName);

Reimplemented from rdModel.

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

Get the current pseudo-states.

The pseudo-states for this model are the horizontal spring zeros. The fist 10 are the spring zeros in the X direction; the second 10 are the spring zeros in the Z direction.

Parameters:
rYP Array to be filled with copies of the pseudo-states. The length of rYP must be at least as large as the value returned by getNYP()- there are 20 for this model.

Reimplemented from rdModel.

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

Get the current value of a state by index.

The states are the generalized coordinates, followed by the generalized speeds, followed by the muscle forces, followed by the muscle activations, followed by other stuff.

Parameters:
aIndex Index of the state: 0 <= aIndex < getNY().
Returns:
Value of the state. rdMath::NAN is returned on an error.
See also:
getStates(double rY[])

getState(const char* aName);

Implements rdModel.

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

Get the current states.

The states are the generalized coordinates, followed by the generalized speeds, followed by the muscle forces, followed by the muscle activations, followed by other stuff.

Parameters:
rY Array to be filled with copies of the states. The length of rY must be at least as large as the value returned by getNY().

Implements rdModel.

double rdUTWalking8::getTFall  )  const
 

Get the fall time of muscle activation.

Returns:
Fall time in seconds.

double rdUTWalking8::getTRise  )  const
 

Get the rise time of muscle activation.

Returns:
Rise time in seconds.

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

Promote the controls to states.

This method assumes that the states of the model have been set using, for example, set() or setStates() and that computeActuation has been called.

Reimplemented from rdModel.

void rdUTWalking8::setActuatorForce int  aID,
double  aForce
[virtual]
 

Set the magnitude of force experted by a particular actuator.

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

Reimplemented from rdModel.

Reimplemented in suUTWalkGenFrc.

void rdUTWalking8::setAllowLeftContact bool  aTrueFalse  ) 
 

Set whether or not to allow left-foot contact forces.

Parameters:
aTrueFalse If true, left-foot contact forces are allowed. If false, they are not allowed.

void rdUTWalking8::setContactPointA int  aID,
const double  rPoint[3]
[virtual]
 

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

Parameters:
aID Index of the desired contact force- 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 rdUTWalking8::setContactPointB int  aID,
const double  rPoint[3]
[virtual]
 

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

Parameters:
aID Index of the desired contact force- 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 rdUTWalking8::setMuson int  aMus,
int  aOnOff
 

Set which muscles are drawn.

A value of 1 is on, 0 off.

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

Set the current pseudo-states.

The pseudo-states for this model are the horizontal spring zeros. The fist 10 are the spring zeros in the X direction; the second 10 are the spring zeros in the Z direction.

Parameters:
aYP Array of pseudo-states. The size of aYP should be the value returned by getNYP()- 20 for this model.

Reimplemented from rdModel.

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

Set the current states.

The states are the generalized coordinates, followed by the generalized speeds, followed by the muscle forces, followed by the muscle activations, followed by other stuff.

Parameters:
aY Array of states. The size of aY should be the value returned by getNY().

Implements rdModel.

void rdUTWalking8::setTFall double  aT  ) 
 

Set the fall time of muscle activation.

Parameters:
aTFall Fall time in seconds. The lower limit is 0.0001 seconds.

void rdUTWalking8::setTRise double  aT  ) 
 

Set the rise time of muscle activation.

Parameters:
aTRise Rise time in seconds. The lower limit is 0.0001 seconds.

void rdUTWalking8::updateGroundZeros double  svel[][3],
double  spos[][3],
double  sfrc[][3]
[virtual]
 

Update the ground spring zeros in the horizontal plane.

The horizontal forces are not allowed to exceed MU times the vertical force, so the horizontal spring zeros are computed to be consistent with this constraint.


Member Data Documentation

double* rdUTWalking8::_yp [protected]
 

Pseudo-states.

These are the spring zeros.

const double rdUTWalking8::k0lig [static]
 

Initial value:

 {
   0.1390577,0.0,0.0,
   0.0,0.0,0.0,0.0,
   0.49257884,0.0,-0.05,
   0.0,0.0,0.0,0.0,
   0.49257884,0.0,-0.05 }

const double rdUTWalking8::k1lig1 [static]
 

Initial value:

 {
   -0.35,-0.25,-0.25,
   -2.44,-0.03, -0.03,-6.09,
   -4.0,-60.21,-0.9,
   -2.44,-0.03, -0.03,-6.09,
   -4.0,-60.21,-0.9 }

const double rdUTWalking8::k1lig2 [static]
 

Initial value:

 {
   0.25,0.25,0.25,
   1.51,0.03, 0.03,11.03,
   1.0,60.21,0.18,
   1.51,0.03, 0.03,11.03,
   1.0,60.21,0.18 }

const double rdUTWalking8::k2lig1 [static]
 

Initial value:

 {
   30.72,20.36,20.36,
   5.05,14.94,14.94,33.94,
   8.0,16.32,14.87,
   5.05,14.94,14.94,33.94,
   8.0,16.32,14.87 }

const double rdUTWalking8::k2lig2 [static]
 

Initial value:

 {
   -20.36,-20.36,-20.36,
   -21.88,-14.94,-14.94,-11.33,
   -22.0,-16.32,-70.08, 
   -21.88,-14.94,-14.94,-11.33,
   -22.0,-16.32,-70.08 }

const double rdUTWalking8::theta1 [static]
 

Initial value:

 {
   0.03,0.17,0.17,
   1.81,0.50,0.92,0.13,
   0.2618,0.65,0.21,
   1.81,0.50,0.92,0.13,
   0.2618,0.65,0.21 }

const double rdUTWalking8::theta2 [static]
 

Initial value:

 {
   -0.35,-0.17,-0.17,
   -0.47,-0.50,-0.92,-2.40,
   -0.4712,-0.65,-0.02,
   -0.47,-0.50,-0.92,-2.40,
   -0.4712,-0.65,-0.02 }


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