GClasses
GClasses::GExtendedKalmanFilter Class Referenceabstract

Detailed Description

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

#include <GKalman.h>

Public Member Functions

 GExtendedKalmanFilter (int stateDims, int obsDims, int controlDims)
 
 ~GExtendedKalmanFilter ()
 
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. More...
 
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. More...
 
void advance (const GVec &control, 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. More...
 
void correct (const GVec &observation, 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. More...
 
virtual void observation (GVec &outObs, const GVec &state)=0
 Computes the observation function. Put results in pOutObs. More...
 
GVecstate ()
 Use this to get and/or set the estimated state. More...
 
GMatrixstateCovariance ()
 Use this to get and/or set the estimated covariance of the state. More...
 
virtual void transition (GVec &inOutState, const GVec &control)=0
 Computes the transition function. (Adjust the values in pInOutState as directed by pControl.) More...
 

Protected Attributes

size_t m_obsDims
 
GMatrixm_pP
 
size_t m_stateDims
 
GVec m_x
 
GVec m_z
 
GVec m_zz
 

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 GVec control,
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 GVec observation,
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 ( GVec outObs,
const GVec state 
)
pure virtual

Computes the observation function. Put results in pOutObs.

GVec& 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 ( GVec inOutState,
const GVec control 
)
pure virtual

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

Member Data Documentation

size_t GClasses::GExtendedKalmanFilter::m_obsDims
protected
GMatrix* GClasses::GExtendedKalmanFilter::m_pP
protected
size_t GClasses::GExtendedKalmanFilter::m_stateDims
protected
GVec GClasses::GExtendedKalmanFilter::m_x
protected
GVec GClasses::GExtendedKalmanFilter::m_z
protected
GVec GClasses::GExtendedKalmanFilter::m_zz
protected