Implemetation of the extended Kalman filter. This class needs to be derived.
More...
#include <ekf2.h>
|
| EKF2 () |
| Constructor, nothing happens here. More...
|
|
| ~EKF2 () |
| Destructur, nothing happens here. More...
|
|
void | InitSystem (int n_states, int n_outputs, const mat &Q, const mat &R) |
| Tell me how many states and outputs you have! More...
|
|
virtual colvec | f (const colvec &x, const colvec &u) |
| Define model of your system. More...
|
|
virtual colvec | h (const colvec &x) |
| Define the output model of your system. More...
|
|
void | InitSystemState (const colvec &x0) |
| Initialize the system states. Must be called after InitSystem. If not called, system state is initialized to zero. More...
|
|
void | InitSystemStateCovariance (const mat &P0) |
| Initialize the system state covariance. Must be called after InitSystem. If not called, state covariance is initialized to an identity matrix. More...
|
|
void | EKalmanf (const colvec &u) |
| Do the extended Kalman iteration step-by-step while simulating the system. Simulating the system is done to calculate system states and outputs. More...
|
|
void | EKalmanf (const colvec &z, const colvec &u) |
| Do the extended Kalman iteration step-by-step without simulating the system. Use this if measurement is available and simulating the system is unnecessary. Here, true system states and system outputs do not matter. The only thing that matters is the estimated states. More...
|
|
colvec * | GetCurrentState () |
| Get current simulated true state. More...
|
|
colvec * | GetCurrentOutput () |
| Get current simulated true output. This is analogous to the measurements. More...
|
|
colvec * | GetCurrentEstimatedState () |
| Get current estimated state. This is analogous to the filtered measurements. More...
|
|
colvec * | GetCurrentEstimatedOutput () |
| Get current estimated output. More...
|
|
Implemetation of the extended Kalman filter. This class needs to be derived.
◆ EKF2()
Constructor, nothing happens here.
◆ ~EKF2()
Destructur, nothing happens here.
◆ EKalmanf() [1/2]
void EKF2::EKalmanf |
( |
const colvec & |
u | ) |
|
Do the extended Kalman iteration step-by-step while simulating the system. Simulating the system is done to calculate system states and outputs.
- Parameters
-
u | The applied input to the system |
◆ EKalmanf() [2/2]
void EKF2::EKalmanf |
( |
const colvec & |
z, |
|
|
const colvec & |
u |
|
) |
| |
Do the extended Kalman iteration step-by-step without simulating the system. Use this if measurement is available and simulating the system is unnecessary. Here, true system states and system outputs do not matter. The only thing that matters is the estimated states.
- Parameters
-
z | The measurement outputs, this is a returned value |
u | The applied input to the system |
◆ f()
colvec EKF2::f |
( |
const colvec & |
x, |
|
|
const colvec & |
u |
|
) |
| |
|
virtual |
Define model of your system.
- Parameters
-
x | System states |
u | System inputs |
◆ GetCurrentEstimatedOutput()
colvec * EKF2::GetCurrentEstimatedOutput |
( |
| ) |
|
Get current estimated output.
- Returns
- Current estimated output \(\hat{z}_k\)
◆ GetCurrentEstimatedState()
colvec * EKF2::GetCurrentEstimatedState |
( |
| ) |
|
Get current estimated state. This is analogous to the filtered measurements.
- Returns
- Current estimated state \(\hat{x}_k\)
◆ GetCurrentOutput()
colvec * EKF2::GetCurrentOutput |
( |
| ) |
|
Get current simulated true output. This is analogous to the measurements.
- Returns
- Current simulated output \(z_k\)
◆ GetCurrentState()
colvec * EKF2::GetCurrentState |
( |
| ) |
|
Get current simulated true state.
- Returns
- Current simulated state of the system \(x_k\)
◆ h()
colvec EKF2::h |
( |
const colvec & |
x | ) |
|
|
virtual |
Define the output model of your system.
- Parameters
-
◆ InitSystem()
void EKF2::InitSystem |
( |
int |
n_states, |
|
|
int |
n_outputs, |
|
|
const mat & |
Q, |
|
|
const mat & |
R |
|
) |
| |
Tell me how many states and outputs you have!
- Parameters
-
n_states | Number of the elements on the input vector x |
n_outputs | Number of the elements on the otput vector z |
Q | Process noise covariance |
R | Measurement noise covariance |
◆ InitSystemState()
void EKF2::InitSystemState |
( |
const colvec & |
x0 | ) |
|
Initialize the system states. Must be called after InitSystem. If not called, system state is initialized to zero.
- Parameters
-
x0 | Inital value for the system state |
◆ InitSystemStateCovariance()
void EKF2::InitSystemStateCovariance |
( |
const mat & |
P0 | ) |
|
Initialize the system state covariance. Must be called after InitSystem. If not called, state covariance is initialized to an identity matrix.
- Parameters
-
P0 | Inital value for the state covariance |
◆ nOutputs_
◆ nStates_
◆ x_
◆ z_
The documentation for this class was generated from the following files: