Class EKF

Inheritance Relationships

Base Type

Class Documentation

class EKF : public lupnt::IFilter

Extended Kalman Filter.

Public Functions

inline EKF()
inline EKF(FilterDynamicsFunction dynamics, FilterProcessNoiseFunction process_noise, FilterMeasurementFunction measurement)
inline void Initialize(const VecX &x0, const MatXd &P0)
inline VecX GetPredictedStateEstimate(MatXd &Pbar)
inline VecX GetPredictedStateEstimate()
inline VecX GetUpdatedStateEstimate(MatXd &Phat)
inline VecX GetUpdatedStateEstimate()
inline VecX GetMeasurementResidual()
inline MatX GetKalmanGain()
inline MatX GetMeasurementNoiseCov()
inline MatX GetMeasurementJacobian()
inline int GetMeasurementSize()
inline void SetOutlierThreshold(double outlier_threshold)
int RemoveOutliers(int m, bool debug = false)

Remove outliers from the measurement.

Parameters:
  • m – number of measurements

  • debug – debug flag

Returns:

int number of measurements after removing outliers

void Predict(Real t_end)

Predict the state to a given time.

Parameters:

t_end – end time

void Update(VecX z_obs, bool debug = false)

Update the state with a measurement.

Parameters:
  • z_obs – measurement

  • debug – debug flag

void Step(Real t_end, VecX z_obs, bool debug = false)

Update the state with a measurement.

Parameters:
  • t_end – end time

  • z_obs – measurement obtained at end time

  • debug – debug flag

Public Members

Real t_curr_
VecX x_
VecX xbar_
MatXd Phi_
VecX dy_
VecX dx_
VecX z_true_
VecX z_pred_
MatXd P_
MatXd Pbar_
MatXd Q_
MatXd H_
MatXd S_
MatXd K_
MatXd R_
double outlier_threshold_ = 3.0