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

rdDynamicFilter Class Reference

This class provides methods for dynamically filtering the kinematics of a system of articulated bodies. More...

#include <rdDynamicFilter.h>

Inheritance diagram for rdDynamicFilter:

rdController rdOptimizationTarget List of all members.

Public Member Functions

virtual ~rdDynamicFilter ()
 Destructor.

 rdDynamicFilter (rdModel *aModel, rdKinematics *aKin)
 Construct a dynamic filter for a model, aModel, and a set of kinematics, aKin.

rdFSQPgetFSQP ()
 Get the FSQP object.

void setQGains (double aQGain)
 Set the tracking factor by which position errors are multiplied.

void setQGains (int aI, double aQGain)
 Set the tracking factor for the generalized coordinate indexed by aI.

double * getQGains ()
 Get the tracking factors by which position errors are multiplied.

void setUGains (double aUGain)
 Set the tracking factor for generalized speed indexed by aI.

void setUGains (int aI, double aUGain)
 Set the tracking factor for the aI.

double * getUGains ()
 Get the tracking factors by which velocity errors are multiplied.

void setTrackingPerformanceWeight (double aW)
 Set the factor by which the tracking component of the performance criterion is weighted.

double getTrackingPerformanceWeight ()
 Get the factor by which the tracking component of the performance criterion is weighted.

void setControlsPerformanceWeight (double aW)
 Set the factor by which the controls component of the performance criterion is weighted.

double getControlsPerformanceWeight ()
 Get the factor by which the controls component of the performance criterion is weighted.

void setLookAhead (double aTimeDelta)
 Set the amount by which acceleration trajectories are anticipated.

double getLookAhead ()
 Get the amount by which acceleration trajectories are anticipated.

void setTrack (bool aTrueFalse)
 Set whether or not to track the generalized coordinates.

void setTrack (int i, bool aTrueFalse)
 Set whether or not to track the generalized coordinate indexed by aI.

bool * getTrack ()
 Get the tracking factors by which velocity errors are multiplied.

double getDT ()
 Get the current integration step size.

double * getCorrectedAccelerations ()
 Set the amount by which acceleration trajectories are anticipated.

int compute (double *x, double *p, double *c)
 Compute performance and the constraints given x.

int computeGradients (double *dx, double *x, double *dpdx, double *dcdx)
 Compute the gradients of the performance and the constraints given x.

int computePerformance (double *x, double *p)
 Compute performance given x.

int computePerformanceGradient (double *x, double *dpdx)
 Compute the gradient of performance given x.

int computeConstraint (double *x, int i, double *c)
 Compute constraint i given x.

int computeConstraintGradient (double *x, int i, double *dcdx)
 Compute the gradient of constraint i given x.

void computeTrajectoryErrors (double t, double *q, double *u, double *qerr, double *uerr, double *dudt)
 Compute the difference between the desired and actual trajectory.

void computeCorrectedAccelerations (double *qerr, double *uerr, double *dudt_d)
 Compute corrected accelerations.

void computeAccelerations (double *x)
 Compute accelerations.

virtual void computeControls (double dt, double t, const double *y, double *x)
 Compute a set of controls for the current model so that the kinematic trajectory of the model is driven toward a set of desired kinematics.

void printTrajectoryErrors ()
 Print the trajectory errors.

void printAccelerations ()
 Print the desired, corrected, and achieved accelerations.


Private Attributes

rdKinematics_kin
rdFSQP_fsqp
int _maxIter
int _ny
int _nq
int _nu
double _dt
double _t
double * _y
double * _ytmp
double * _q
double * _u
double * _qerr
double * _uerr
double * _dqdt
double * _dudt_d
double * _dudt_c
double * _dudt
double * _kq
double * _ku
double _kAcc
double _kX
double _lookAhead
bool * _track

Detailed Description

This class provides methods for dynamically filtering the kinematics of a system of articulated bodies.

The filtering is dynamic in that the inertial characteristics of the bodies, as well as the physical properties of the system actuators (e.g., torque motors, muscles, ...), are implicitly taken into account.

This class extends rdController and so can be set as valid controller during an integration. See class rdIntegRKF.

Author:
Frank C. Anderson
Version:
1.0
See also:
rdController, rdIntegRKF


Member Function Documentation

int rdDynamicFilter::compute double *  x,
double *  p,
double *  c
[virtual]
 

Compute performance and the constraints given x.

Note - used by paramopt.

Implements rdOptimizationTarget.

void rdDynamicFilter::computeAccelerations double *  x  ) 
 

Compute accelerations.

This routines modifies the desired accelerations based on differences between the actual positions and velocities and the desired positions and velocities.

Parameters:
t The time.
q The generalized coordinates.
u The generalized speeds.
dudt_c The corrected accelerations (time derivatives of u).
Todo:
aDT should be passed in to promoteControlsToStates().

int rdDynamicFilter::computeConstraint double *  x,
int  i,
double *  c
[virtual]
 

Compute constraint i given x.

Note that the indexing starts at 1;

Implements rdOptimizationTarget.

void rdDynamicFilter::computeControls double  dt,
double  t,
const double *  y,
double *  x
[virtual]
 

Compute a set of controls for the current model so that the kinematic trajectory of the model is driven toward a set of desired kinematics.

Parameters:
dt Integration time step that will be attempted.
t Current time.
y Current states of the system.
x Current controls.
Returns:
-1 if an error is encountered, 0 otherwise.

void rdDynamicFilter::computeCorrectedAccelerations double *  qerr,
double *  uerr,
double *  dudt_d
 

Compute corrected accelerations.

This routines modifies the desired accelerations based on differences between the actual positions and velocities and the desired positions and velocities.

Parameters:
t The time.
q The generalized coordinates.
u The generalized speeds.
dudt_c The corrected accelerations (time derivatives of u).

int rdDynamicFilter::computeGradients double *  dx,
double *  x,
double *  dpdx,
double *  dcdx
[virtual]
 

Compute the gradients of the performance and the constraints given x.

The array dx is an array of perturbation sizes which can be used to compute the gradients numerically.

Note- used by paramopt.

Implements rdOptimizationTarget.

int rdDynamicFilter::computePerformanceGradient double *  x,
double *  dpdx
[virtual]
 

Compute the gradient of performance given x.

This method uses central differences.

Implements rdOptimizationTarget.

void rdDynamicFilter::computeTrajectoryErrors double  t,
double *  q,
double *  u,
double *  qerr,
double *  uerr,
double *  dudt
 

Compute the difference between the desired and actual trajectory.

Note that q must be expressed in angles not quaterions.

Parameters:
t The time.
q The generalized coordinates converted to angles.
u The generalized speeds.


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