24 #define _USE_MATH_DEFINES
56 void InitSystem(
int n_states,
int n_outputs,
const mat& Q,
const mat& R);
62 virtual colvec
f(
const colvec &x,
const colvec &u);
68 virtual colvec
h(
const colvec &x);
101 void EKalmanf(
const colvec& z,
const colvec& u);
136 mat CalcFx(
const colvec &x,
const colvec &u);
143 mat CalcHx(
const colvec &x);
152 mat CalcFxx(
const colvec &x,
const colvec &u,
const int i);
161 mat CalcHxx(
const colvec &x,
const int i);
169 colvec e(
const int i,
const int max_len);
Implemetation of the extended Kalman filter. This class needs to be derived.
Definition: ekf2.h:37
~EKF2()
Destructur, nothing happens here.
Definition: ekf2.cpp:15
int nStates_
Number of the states.
Definition: ekf2.h:191
colvec x_
State vector.
Definition: ekf2.h:194
void InitSystemState(const colvec &x0)
Initialize the system states. Must be called after InitSystem. If not called, system state is initial...
Definition: ekf2.cpp:169
colvec * GetCurrentOutput()
Get current simulated true output. This is analogous to the measurements.
Definition: ekf2.cpp:268
void EKalmanf(const colvec &u)
Do the extended Kalman iteration step-by-step while simulating the system. Simulating the system is d...
Definition: ekf2.cpp:182
void InitSystemStateCovariance(const mat &P0)
Initialize the system state covariance. Must be called after InitSystem. If not called,...
Definition: ekf2.cpp:176
EKF2()
Constructor, nothing happens here.
Definition: ekf2.cpp:10
virtual colvec h(const colvec &x)
Define the output model of your system.
Definition: ekf2.cpp:65
colvec * GetCurrentEstimatedOutput()
Get current estimated output.
Definition: ekf2.cpp:279
colvec * GetCurrentEstimatedState()
Get current estimated state. This is analogous to the filtered measurements.
Definition: ekf2.cpp:273
colvec z_
Output matrix.
Definition: ekf2.h:195
void InitSystem(int n_states, int n_outputs, const mat &Q, const mat &R)
Tell me how many states and outputs you have!
Definition: ekf2.cpp:20
int nOutputs_
Number of outputs.
Definition: ekf2.h:192
colvec * GetCurrentState()
Get current simulated true state.
Definition: ekf2.cpp:263
virtual colvec f(const colvec &x, const colvec &u)
Define model of your system.
Definition: ekf2.cpp:58