#include <kalman.h>
Public Member Functions | |
EKF (arma::uword _N, arma::uword _M, arma::uword _L) | |
void | set_diff_step (double _dx) |
void | set_state_jac (fcn_m _f) |
void | set_meas_jac (fcn_m _h) |
void | jacobian_diff (arma::mat &_F, fcn_v _f, const arma::mat &_x) |
void | jacobian_diff (arma::mat &_F, fcn_v _f) |
void | jacobian_analytical (arma::mat &_F, fcn_m _f_m, const arma::mat &_x) |
void | jacobian_analytical (arma::mat &_F, fcn_m _f_m) |
void | predict (const arma::mat u) |
void | predict (void) |
void | update (const arma::mat z) |
void | rts_smooth (const arma::mat &Xf, const arma::cube &Pf, arma::mat &Xs, arma::cube &Ps) |
Public Member Functions inherited from sp::KF | |
KF (arma::uword _N, arma::uword _M, arma::uword _L) | |
~KF () | |
void | clear (void) |
void | set_state_vec (const arma::mat &_x) |
void | set_trans_mat (const arma::mat &_A) |
void | set_control_mat (const arma::mat &_B) |
void | set_meas_mat (const arma::mat &_H) |
void | set_err_cov (const arma::mat &_P) |
void | set_proc_noise (const arma::mat &_Q) |
void | set_meas_noise (const arma::mat &_R) |
void | set_kalman_gain (const arma::mat &_K) |
void | set_trans_fcn (fcn_v _f) |
void | set_meas_fcn (fcn_v _h) |
arma::mat | get_state_vec (void) |
arma::mat | get_err (void) |
arma::mat | get_kalman_gain (void) |
arma::mat | get_err_cov (void) |
void | predict (const arma::mat u) |
void | predict (void) |
void | update (const arma::mat z) |
void | rts_smooth (const arma::mat &Xf, const arma::cube &Pf, arma::mat &Xs, arma::cube &Ps) |
Protected Attributes | |
fcn_m | f_jac |
fcn_m | h_jac |
double | dx |
Protected Attributes inherited from sp::KF | |
arma::uword | N |
arma::uword | M |
arma::uword | L |
bool | lin_proc |
bool | lin_meas |
arma::mat | x |
arma::mat | z_err |
arma::mat | A |
arma::mat | B |
arma::mat | H |
arma::mat | P |
arma::mat | Q |
arma::mat | R |
arma::mat | K |
fcn_v | f |
fcn_v | h |
Implements Kalman functions for the discrete system with additive noise
\[ x_k = f(x_{k-1})+Bu_{k-1} + w_{k-1} \]
and with measurements
\[ z_k = h(x_k) + v_k \]
where f(x) and h(x) may be nonlinear functions. The predicting stage is
\[ \hat{x}^-_k = A\hat{x}_{k-1}+Bu_{k-1} \]
\[ P^-_k = AP_{k-1}A^T+Q \]
and the updates stage
\[ K_k = P^-_kH^T(HP^-_kH^T+R)^{-1} \]
\[ \hat{x}_k = \hat{x}^-_k + K_k(z_k-H\hat{x}^-_k) \]
\[ P_k = (I-K_kH)P^-_k \]
Where A and H is the Jacobians of f(x) and h(x) functions.
For detailed info see: http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf