libnxter  0.1
Data Structures | Functions
KalmanFilter.nxc File Reference

Kalman Filter implementation for multidimentional state vector. More...

#include "Debug.nxc"
#include "Matrix.nxc"
#include "RandomNorm.nxc"
Include dependency graph for KalmanFilter.nxc:

Go to the source code of this file.

Data Structures

struct  KalmanFilter
 Kalman Filter class representing the kalman model and state updates. In practice, upto only 3 dimentional state vector is usable before hitting hardware limitation. More...
 

Functions

void KalmanFilterInit (KalmanFilter &filter, Matrix &A, Matrix &B, Matrix &H, Matrix &Q, Matrix &R, Matrix &P0, Matrix &X0)
 Initializes the kalman filter with given paramters. matrix A is the state transition model, matrix B is the input transformation model, matrix H is the obervation transformation model, matrix Q is the state transition uncertainity covariance, matrix R is obervation uncertainity covariance, matrix P0 is the initial state (X0) error covariance (i.e. accuracy of the initially choose state) and matrix X0 is the initially decided state.
 
void KalmanFilterInitUnity (KalmanFilter &filter, Matrix &Q, Matrix &R, Matrix &P0, Matrix &X0)
 Initializes the kalman filter in unity mode with given paramters. Unity mode runs the filter with the assumption A = B = H = 1. This skips many of the matrix operations and can make the filter run faster. It is better to use this mode in certain cases where state X, observation Z and control U are all in the same dimension. matrix Q is the state transition uncertainity covariance, matrix R is obervation uncertainity covariance, matrix P0 is the initial state (X0) error covariance (i.e. accuracy of the initially choose state) and matrix X0 is the initially choosen state.
 
void KalmanFilterGetX (KalmanFilter &filter, Matrix &X)
 Gets the current estimated state in the filter and returns it in X.
 
void KalmanFilterGetP (KalmanFilter &filter, Matrix &P)
 Gets the current error covariance of the current estimated state in the filter and returns it in P. Error covariance is defines the accuracy of the estimated state X.
 
void KalmanFilterStep (KalmanFilter &filter, Matrix &U, Matrix &Z)
 Runs the filter step. matrix U is the current state control input and matrix Z is the current observation of the state. Control input U and obsevation Z will be transformed by matrix B and matrix H respectively before contributing to the final state transition.
 

Detailed Description

Kalman Filter implementation for multidimentional state vector.

Definition in file KalmanFilter.nxc.