Implemetation of the Unscented Kalman filter. This class needs to be derived.
More...
#include <ukf.h>
|
| UKF () |
| Constructor, nothing happens here. More...
|
|
| ~UKF () |
| 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 | UKalmanf (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 | UKalmanf (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 Unscented Kalman filter. This class needs to be derived.
◆ UKF()
Constructor, nothing happens here.
◆ ~UKF()
Destructur, nothing happens here.
◆ f()
colvec UKF::f |
( |
const colvec & |
x, |
|
|
const colvec & |
u |
|
) |
| |
|
virtual |
Define model of your system.
- Parameters
-
x | System states |
u | System inputs |
◆ GetCurrentEstimatedOutput()
colvec * UKF::GetCurrentEstimatedOutput |
( |
| ) |
|
Get current estimated output.
- Returns
- Current estimated output \(\hat{z}_k\)
◆ GetCurrentEstimatedState()
colvec * UKF::GetCurrentEstimatedState |
( |
| ) |
|
Get current estimated state. This is analogous to the filtered measurements.
- Returns
- Current estimated state \(\hat{x}_k\)
◆ GetCurrentOutput()
colvec * UKF::GetCurrentOutput |
( |
| ) |
|
Get current simulated true output. This is analogous to the measurements.
- Returns
- Current simulated output \(z_k\)
◆ GetCurrentState()
colvec * UKF::GetCurrentState |
( |
| ) |
|
Get current simulated true state.
- Returns
- Current simulated state of the system \(x_k\)
◆ h()
colvec UKF::h |
( |
const colvec & |
x | ) |
|
|
virtual |
Define the output model of your system.
- Parameters
-
◆ InitSystem()
void UKF::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 UKF::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 UKF::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 |
◆ UKalmanf() [1/2]
void UKF::UKalmanf |
( |
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 |
◆ UKalmanf() [2/2]
void UKF::UKalmanf |
( |
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 |
◆ nOutputs_
◆ nStates_
◆ x_
State vector, by simulaiton, true value.
◆ z_
Output matrix, by simulation, true value.
The documentation for this class was generated from the following files: