14 #include <Eigen/Dense>
15 #include <boost/math/distributions/chi_squared.hpp>
33 Chi2(
const int& dof,
const double& chi_value);
52 void get_result(Eigen::MatrixXd*
const last_res,
double*
const last_X2)
const;
71 bool CalculateChi2(
const Eigen::MatrixXd& res,
const Eigen::MatrixXd& S);
94 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
103 Ekf(
const Eigen::Ref<const Eigen::MatrixXd>& H,
const Eigen::Ref<const Eigen::MatrixXd>& R,
104 const Eigen::Ref<const Eigen::MatrixXd>& res,
const Eigen::Ref<const Eigen::MatrixXd>& P)
bool passed_
Determine if the test is performed or not.
Definition: ekf.h:84
bool CalculateChi2(const Eigen::MatrixXd &res, const Eigen::MatrixXd &S)
CalculateChi2 Calculate the X2 value and compare it to the upper critical value (UCV)
void set_chi_value(const double &value)
set_chi_value Set chi value for the calculation of the upper critical value
int dof_
Chi2 distribution, generated based on the DoF.
Definition: ekf.h:80
Chi2(const int &dof, const double &chi_value)
Chi2 Constructor.
void get_result(Eigen::MatrixXd *const last_res, double *const last_X2) const
get_result Returns the last report values, i.e. last residual and X2 value
bool do_test_
Upper critival value.
Definition: ekf.h:83
double ucv_
Chi value for the confidence intervall (0.05 represents 95% test)
Definition: ekf.h:82
void set_dof(const int &value)
set_dof Set degree of freedom for the X2 distribution
void ActivateTest(const bool &value)
ActivateTest Enable or disable the X2 test.
Chi2()
Chi2 Default constructor.
Eigen::MatrixXd last_res_
Shows if the test passed or not (true=passed)
Definition: ekf.h:87
double chi_value_
Degrees of freedom for the setup.
Definition: ekf.h:81
boost::math::chi_squared dist_
Definition: ekf.h:79
double last_X2_
Last residual, for the report.
Definition: ekf.h:88
void PrintReport(const std::string &name)
PrintReport Print a formated report e.g. if the test did not pass.
void CalculateUcv()
CalculateUcv Perform the calculation of the upper critical value.
Eigen::MatrixXd H_
Definition: ekf.h:112
Eigen::MatrixXd res_
Measurement noise.
Definition: ekf.h:114
Eigen::MatrixXd P_
Residual.
Definition: ekf.h:115
Eigen::MatrixXd CalculateCorrection(Chi2 *chi2)
CalculateCorrection Calculating the state correction with a post Chi2 test.
Eigen::MatrixXd CalculateStateCorrection()
CalculateStateCorrection Calculation of EKF components, correction, innovation etc.
Eigen::MatrixXd CalculateCovUpdate()
CalculateCovUpdate Updating the state covariance after the state update.
Eigen::MatrixXd S_
State covariance.
Definition: ekf.h:116
Eigen::MatrixXd K_
Innovation / variance of the residual.
Definition: ekf.h:117
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Ekf(const Eigen::Ref< const Eigen::MatrixXd > &H, const Eigen::Ref< const Eigen::MatrixXd > &R, const Eigen::Ref< const Eigen::MatrixXd > &res, const Eigen::Ref< const Eigen::MatrixXd > &P)
Ekf Essential EFK update component.
Definition: ekf.h:103
Eigen::MatrixXd CalculateCorrection()
Kalman gain.
Eigen::MatrixXd R_
Jacobian.
Definition: ekf.h:113