mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
Public Member Functions | Public Attributes | Private Attributes | List of all members
mars::Chi2 Class Reference

#include </home/runner/work/mars_lib/mars_lib/source/mars/include/mars/ekf.h>

+ Collaboration diagram for mars::Chi2:

Public Member Functions

 Chi2 ()
 Chi2 Default constructor. More...
 
 Chi2 (const int &dof, const double &chi_value)
 Chi2 Constructor. More...
 
void set_dof (const int &value)
 set_dof Set degree of freedom for the X2 distribution More...
 
void set_chi_value (const double &value)
 set_chi_value Set chi value for the calculation of the upper critical value More...
 
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 More...
 
void CalculateUcv ()
 CalculateUcv Perform the calculation of the upper critical value. More...
 
void ActivateTest (const bool &value)
 ActivateTest Enable or disable the X2 test. More...
 
bool CalculateChi2 (const Eigen::MatrixXd &res, const Eigen::MatrixXd &S)
 CalculateChi2 Calculate the X2 value and compare it to the upper critical value (UCV) More...
 
void PrintReport (const std::string &name)
 PrintReport Print a formated report e.g. if the test did not pass. More...
 

Public Attributes

boost::math::chi_squared dist_
 
int dof_ { 3 }
 Chi2 distribution, generated based on the DoF. More...
 
double chi_value_ { 0.05 }
 Degrees of freedom for the setup. More...
 
double ucv_
 Chi value for the confidence intervall (0.05 represents 95% test) More...
 
bool do_test_ { true }
 Upper critival value. More...
 
bool passed_ { false }
 Determine if the test is performed or not. More...
 

Private Attributes

Eigen::MatrixXd last_res_
 Shows if the test passed or not (true=passed) More...
 
double last_X2_
 Last residual, for the report. More...
 

Constructor & Destructor Documentation

◆ Chi2() [1/2]

mars::Chi2::Chi2 ( )

Chi2 Default constructor.

◆ Chi2() [2/2]

mars::Chi2::Chi2 ( const int &  dof,
const double &  chi_value 
)

Chi2 Constructor.

Parameters
dofDegrees of freedom of the measurement
chi_valueChi value to determine the confidence interval

Member Function Documentation

◆ set_dof()

void mars::Chi2::set_dof ( const int &  value)

set_dof Set degree of freedom for the X2 distribution

Parameters
valueDegrees of freedom
+ Here is the caller graph for this function:

◆ set_chi_value()

void mars::Chi2::set_chi_value ( const double &  value)

set_chi_value Set chi value for the calculation of the upper critical value

Parameters
valueChi value

◆ get_result()

void mars::Chi2::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

Parameters
last_reslast residual
last_X2last X2 value

◆ CalculateUcv()

void mars::Chi2::CalculateUcv ( )

CalculateUcv Perform the calculation of the upper critical value.

◆ ActivateTest()

void mars::Chi2::ActivateTest ( const bool &  value)

ActivateTest Enable or disable the X2 test.

Parameters
valueTrue for enabeling, false for disabeling

◆ CalculateChi2()

bool mars::Chi2::CalculateChi2 ( const Eigen::MatrixXd &  res,
const Eigen::MatrixXd &  S 
)

CalculateChi2 Calculate the X2 value and compare it to the upper critical value (UCV)

Parameters
resResidual
SInnovation / Variance of the residual
Returns
True if the test passed, false if it did not pass

◆ PrintReport()

void mars::Chi2::PrintReport ( const std::string &  name)

PrintReport Print a formated report e.g. if the test did not pass.

Parameters
nameName of the sensor, used in the print
+ Here is the caller graph for this function:

Member Data Documentation

◆ dist_

boost::math::chi_squared mars::Chi2::dist_

◆ dof_

int mars::Chi2::dof_ { 3 }

Chi2 distribution, generated based on the DoF.

◆ chi_value_

double mars::Chi2::chi_value_ { 0.05 }

Degrees of freedom for the setup.

◆ ucv_

double mars::Chi2::ucv_

Chi value for the confidence intervall (0.05 represents 95% test)

◆ do_test_

bool mars::Chi2::do_test_ { true }

Upper critival value.

◆ passed_

bool mars::Chi2::passed_ { false }

Determine if the test is performed or not.

◆ last_res_

Eigen::MatrixXd mars::Chi2::last_res_
private

Shows if the test passed or not (true=passed)

◆ last_X2_

double mars::Chi2::last_X2_
private

Last residual, for the report.


The documentation for this class was generated from the following file: