GClasses

GClasses::GExtendedKalmanFilter Class Reference

This is an implementation of the Extended Kalman Filter. This class is used by alternately calling advance and correct. More...

#include <GKalman.h>

List of all members.

Public Member Functions

 GExtendedKalmanFilter (int stateDims, int obsDims, int controlDims)
 ~GExtendedKalmanFilter ()
double * state ()
 Use this to get and/or set the estimated state.
GMatrixstateCovariance ()
 Use this to get and/or set the estimated covariance of the state.
void advance (const double *pControl, GMatrix *pA)
 Advance to the next time step. pControl is the control vector to apply to the system at the current time step. pA is the Jacobian of the transition function at the current state, and with this control vector. Each column in pA represents the change in f(x,u) over the change in one of the dimensions of x, where f is the transition function, x is the state, and u is the control vector.
void correct (const double *pObservation, GMatrix *pH)
 Correct the estimates of state and covariance based on the observations made in the new state (and assuming the observation function is locally linear around the current state). pH is the Jacobian of the observation function at the current state. Each column in pH represents the change in h(x) over the change in one of the dimensions of x, where h is the observation function, and x is the state.
virtual void transition (double *pInOutState, const double *pControl)=0
 Computes the transition function. (Adjust the values in pInOutState as directed by pControl.)
virtual void observation (double *pOutObs, const double *pState)=0
 Computes the observation function. Put results in pOutObs.
virtual void addTransitionNoise (GMatrix *pInOutCov)=0
 pInOutCov is a nxn matrix, where n is the number of state dims. This method should add the covariance of the transition noise to pInOutCov.
virtual void addObservationNoise (GMatrix *pInOutCov)=0
 pInOutCov is a mxm matrix, where m is the number of observation dims. This method should add the covariance of the observation noise to pInOutCov.

Protected Attributes

size_t m_stateDims
size_t m_obsDims
double * m_x
double * m_z
double * m_zz
GMatrixm_pP

Detailed Description

This is an implementation of the Extended Kalman Filter. This class is used by alternately calling advance and correct.


Constructor & Destructor Documentation

GClasses::GExtendedKalmanFilter::GExtendedKalmanFilter ( int  stateDims,
int  obsDims,
int  controlDims 
)
GClasses::GExtendedKalmanFilter::~GExtendedKalmanFilter ( )

Member Function Documentation

virtual void GClasses::GExtendedKalmanFilter::addObservationNoise ( GMatrix pInOutCov) [pure virtual]

pInOutCov is a mxm matrix, where m is the number of observation dims. This method should add the covariance of the observation noise to pInOutCov.

virtual void GClasses::GExtendedKalmanFilter::addTransitionNoise ( GMatrix pInOutCov) [pure virtual]

pInOutCov is a nxn matrix, where n is the number of state dims. This method should add the covariance of the transition noise to pInOutCov.

void GClasses::GExtendedKalmanFilter::advance ( const double *  pControl,
GMatrix pA 
)

Advance to the next time step. pControl is the control vector to apply to the system at the current time step. pA is the Jacobian of the transition function at the current state, and with this control vector. Each column in pA represents the change in f(x,u) over the change in one of the dimensions of x, where f is the transition function, x is the state, and u is the control vector.

void GClasses::GExtendedKalmanFilter::correct ( const double *  pObservation,
GMatrix pH 
)

Correct the estimates of state and covariance based on the observations made in the new state (and assuming the observation function is locally linear around the current state). pH is the Jacobian of the observation function at the current state. Each column in pH represents the change in h(x) over the change in one of the dimensions of x, where h is the observation function, and x is the state.

virtual void GClasses::GExtendedKalmanFilter::observation ( double *  pOutObs,
const double *  pState 
) [pure virtual]

Computes the observation function. Put results in pOutObs.

double* GClasses::GExtendedKalmanFilter::state ( ) [inline]

Use this to get and/or set the estimated state.

GMatrix* GClasses::GExtendedKalmanFilter::stateCovariance ( ) [inline]

Use this to get and/or set the estimated covariance of the state.

virtual void GClasses::GExtendedKalmanFilter::transition ( double *  pInOutState,
const double *  pControl 
) [pure virtual]

Computes the transition function. (Adjust the values in pInOutState as directed by pControl.)


Member Data Documentation