PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <KalmanFilter.h>
Public Member Functions | |
KalmanFilter () | |
Default constructor, state not initialized. More... | |
KalmanFilter (matrix::Vector< float, 2 > &initial, matrix::Matrix< float, 2, 2 > &covInit) | |
Constructor, initialize state. More... | |
virtual | ~KalmanFilter () |
Default desctructor. More... | |
void | init (matrix::Vector< float, 2 > &initial, matrix::Matrix< float, 2, 2 > &covInit) |
Initialize filter state. More... | |
void | init (float initial0, float initial1, float covInit00, float covInit11) |
Initialize filter state, only specifying diagonal covariance elements. More... | |
void | predict (float dt, float acc, float acc_unc) |
Predict the state with an external acceleration estimate. More... | |
bool | update (float meas, float measUnc) |
Update the state estimate with a measurement. More... | |
void | getState (matrix::Vector< float, 2 > &state) |
Get the current filter state. More... | |
void | getState (float &state0, float &state1) |
Get the current filter state. More... | |
void | getCovariance (matrix::Matrix< float, 2, 2 > &covariance) |
Get state covariance. More... | |
void | getCovariance (float &cov00, float &cov11) |
Get state variances (diagonal elements) More... | |
void | getInnovations (float &innov, float &innovCov) |
Get measurement innovation and covariance of last update call. More... | |
Private Attributes | |
matrix::Vector< float, 2 > | _x |
matrix::Matrix< float, 2, 2 > | _covariance |
float | _residual |
float | _innovCov |
Definition at line 58 of file KalmanFilter.h.
|
inline |
Default constructor, state not initialized.
Definition at line 64 of file KalmanFilter.h.
landing_target_estimator::KalmanFilter::KalmanFilter | ( | matrix::Vector< float, 2 > & | initial, |
matrix::Matrix< float, 2, 2 > & | covInit | ||
) |
Constructor, initialize state.
Definition at line 46 of file KalmanFilter.cpp.
References init().
|
inlinevirtual |
Default desctructor.
Definition at line 74 of file KalmanFilter.h.
References dt, getCovariance(), getInnovations(), getState(), init(), predict(), state, and update().
void landing_target_estimator::KalmanFilter::getCovariance | ( | matrix::Matrix< float, 2, 2 > & | covariance | ) |
Get state covariance.
covariance | Covariance of the state |
Definition at line 136 of file KalmanFilter.cpp.
References _covariance.
Referenced by landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
void landing_target_estimator::KalmanFilter::getCovariance | ( | float & | cov00, |
float & | cov11 | ||
) |
Get state variances (diagonal elements)
cov00 | Variance of first state |
cov11 | Variance of second state |
Definition at line 141 of file KalmanFilter.cpp.
References _covariance.
void landing_target_estimator::KalmanFilter::getInnovations | ( | float & | innov, |
float & | innovCov | ||
) |
Get measurement innovation and covariance of last update call.
innov | Measurement innovation |
innovCov | Measurement innovation covariance |
Definition at line 147 of file KalmanFilter.cpp.
References _innovCov, and _residual.
Referenced by landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
void landing_target_estimator::KalmanFilter::getState | ( | matrix::Vector< float, 2 > & | state | ) |
Get the current filter state.
x1 | State |
Definition at line 125 of file KalmanFilter.cpp.
References _x.
Referenced by landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
void landing_target_estimator::KalmanFilter::getState | ( | float & | state0, |
float & | state1 | ||
) |
Get the current filter state.
state0 | First state |
state1 | Second state |
Definition at line 130 of file KalmanFilter.cpp.
References _x.
void landing_target_estimator::KalmanFilter::init | ( | matrix::Vector< float, 2 > & | initial, |
matrix::Matrix< float, 2, 2 > & | covInit | ||
) |
Initialize filter state.
initial | initial state |
covInit | initial covariance |
Definition at line 51 of file KalmanFilter.cpp.
References _covariance, and _x.
Referenced by init(), KalmanFilter(), landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
void landing_target_estimator::KalmanFilter::init | ( | float | initial0, |
float | initial1, | ||
float | covInit00, | ||
float | covInit11 | ||
) |
Initialize filter state, only specifying diagonal covariance elements.
initial0 | first initial state |
initial1 | second initial state |
covInit00 | initial variance of first state |
covinit11 | initial variance of second state |
Definition at line 57 of file KalmanFilter.cpp.
References init().
void landing_target_estimator::KalmanFilter::predict | ( | float | dt, |
float | acc, | ||
float | acc_unc | ||
) |
Predict the state with an external acceleration estimate.
dt | Time delta in seconds since last state change |
acc | Acceleration estimate |
acc_unc | Variance of acceleration estimate |
Definition at line 69 of file KalmanFilter.cpp.
References _covariance, _x, dt, and matrix::Matrix< Type, M, N >::transpose().
Referenced by landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
bool landing_target_estimator::KalmanFilter::update | ( | float | meas, |
float | measUnc | ||
) |
Update the state estimate with a measurement.
meas | state measeasurement |
measUnc | measurement uncertainty |
Definition at line 88 of file KalmanFilter.cpp.
References _covariance, _innovCov, _residual, _x, f(), and matrix::Matrix< Type, M, N >::identity().
Referenced by landing_target_estimator::LandingTargetEstimator::update(), and ~KalmanFilter().
|
private |
Definition at line 144 of file KalmanFilter.h.
Referenced by getCovariance(), init(), predict(), and update().
|
private |
Definition at line 148 of file KalmanFilter.h.
Referenced by getInnovations(), and update().
|
private |
Definition at line 146 of file KalmanFilter.h.
Referenced by getInnovations(), and update().
|
private |
Definition at line 142 of file KalmanFilter.h.
Referenced by getState(), init(), predict(), and update().