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);
100 void EKalmanf(
const colvec& z,
const colvec& u);
135 void CalcF(
const colvec &x,
const colvec &u);
142 void CalcH(
const colvec &x);
Implemetation of the extended Kalman filter. This class needs to be derived.
Definition: ekf.h:37
colvec * GetCurrentEstimatedOutput()
Get current estimated output.
Definition: ekf.cpp:186
void EKalmanf(const colvec &u)
Do the extended Kalman iteration step-by-step while simulating the system. Simulating the system is d...
Definition: ekf.cpp:125
colvec x_
State vector.
Definition: ekf.h:171
void InitSystemState(const colvec &x0)
Initialize the system states. Must be called after InitSystem. If not called, system state is initial...
Definition: ekf.cpp:111
colvec z_
Output matrix.
Definition: ekf.h:172
void InitSystemStateCovariance(const mat &P0)
Initialize the system state covariance. Must be called after InitSystem. If not called,...
Definition: ekf.cpp:118
virtual colvec f(const colvec &x, const colvec &u)
Define model of your system.
Definition: ekf.cpp:60
int nOutputs_
Number of outputs.
Definition: ekf.h:169
colvec * GetCurrentOutput()
Get current simulated true output. This is analogous to the measurements.
Definition: ekf.cpp:175
void InitSystem(int n_states, int n_outputs, const mat &Q, const mat &R)
Tell me how many states and outputs you have!
Definition: ekf.cpp:20
EKF()
Constructor, nothing happens here.
Definition: ekf.cpp:10
~EKF()
Destructur, nothing happens here.
Definition: ekf.cpp:15
virtual colvec h(const colvec &x)
Define the output model of your system.
Definition: ekf.cpp:67
colvec * GetCurrentEstimatedState()
Get current estimated state. This is analogous to the filtered measurements.
Definition: ekf.cpp:180
int nStates_
Number of the states.
Definition: ekf.h:168
colvec * GetCurrentState()
Get current simulated true state.
Definition: ekf.cpp:170