|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Go to the documentation of this file.
38 template <
int n_states,
int n_inputs,
int n_measurements>
43 static constexpr
int n = n_states;
44 static constexpr
int m = n_inputs;
45 static constexpr
int p = n_measurements;
46 static constexpr
int w = 2 *
n + 1;
50 using X_t =
typename Eigen::Matrix<double, n, w>;
51 using Z_t =
typename Eigen::Matrix<double, p, w>;
52 using Pzz_t =
typename Eigen::Matrix<double, p, p>;
53 using K_t =
typename Eigen::Matrix<double, n, p>;
71 using W_t =
typename Eigen::Matrix<double, w, 1>;
82 const char* what()
const throw()
84 return "UKF: taking the square root of covariance update produced NANs!!!";
91 const char* what()
const throw()
93 return "UKF: inverting of Pzz in correction update produced NANs!!!";
153 void setConstants(
const double alpha,
const double kappa,
const double beta);
177 void computeWeights();
179 X_t computeSigmas(
const x_t& x,
const P_t& P)
const;
181 P_t computePaSqrt(
const P_t& P)
const;
185 virtual K_t computeKalmanGain([[maybe_unused]]
const x_t& x, [[maybe_unused]]
const z_t& inn,
const K_t& Pxz,
const Pzz_t& Pzz)
const;
187 double m_alpha, m_kappa, m_beta, m_lambda;
typename Eigen::Matrix< double, n, w > X_t
State sigma points matrix.
Definition: ukf.h:50
is thrown when taking the square root of a matrix fails during sigma generation
Definition: ukf.h:80
void setConstants(const double alpha, const double kappa, const double beta)
Changes the Unscented Transform parameters.
Definition: ukf.hpp:61
UKF()
Convenience default constructor.
Definition: ukf.hpp:20
typename Base_class::z_t z_t
measurement vector p*1 typedef
Definition: ukf.h:63
static constexpr int n
Length of the state vector of the system.
Definition: ukf.h:43
Eigen::Matrix< double, p, p > R_t
Measurement noise covariance matrix type .
Definition: kalman_filter.h:39
typename Eigen::Matrix< double, n, p > K_t
Kalman gain matrix.
Definition: ukf.h:53
Implements UKF - a class implementing the Unscented Kalman Filter.
static constexpr int p
Length of the measurement vector of the system.
Definition: ukf.h:45
typename std::function< x_t(const x_t &, const u_t &, double)> transition_model_t
function of the state transition model typedef
Definition: ukf.h:75
virtual statecov_t correct(const statecov_t &sc, const z_t &z, const R_t &R) const override
Implements the state correction step (measurement update).
Definition: ukf.hpp:223
Eigen::Matrix< double, n, n > P_t
State uncertainty covariance matrix type .
Definition: kalman_filter.h:38
typename Base_class::statecov_t statecov_t
typedef of a helper struct for state and covariance
Definition: ukf.h:73
typename Eigen::Matrix< double, w, 1 > W_t
weights vector (2n+1)*1 typedef
Definition: ukf.h:71
Eigen::Matrix< double, m, 1 > u_t
Input vector type .
Definition: kalman_filter.h:35
static constexpr int w
Number of sigma points/weights.
Definition: ukf.h:46
typename std::function< z_t(const x_t &)> observation_model_t
function of the observation model typedef
Definition: ukf.h:77
void setObservationModel(const observation_model_t &observation_model)
Changes the observation model function.
Definition: ukf.hpp:85
Eigen::Matrix< double, n, 1 > x_t
State vector type .
Definition: kalman_filter.h:34
All mrs_lib functions, classes, variables and definitions are contained in this namespace.
Definition: attitude_converter.h:29
void setTransitionModel(const transition_model_t &transition_model)
Changes the transition model function.
Definition: ukf.hpp:75
Defines KalmanFilter - an abstract class, defining common interfaces and types for a generic Kalman f...
typename Eigen::Matrix< double, p, p > Pzz_t
Pzz helper matrix.
Definition: ukf.h:52
static constexpr int m
Length of the input vector of the system.
Definition: ukf.h:44
virtual statecov_t predict(const statecov_t &sc, const u_t &u, const Q_t &Q, double dt) const override
Implements the state prediction step (time update).
Definition: ukf.hpp:178
typename Base_class::x_t x_t
state vector n*1 typedef
Definition: ukf.h:59
Eigen::Matrix< double, n, n > Q_t
Process noise covariance matrix type .
Definition: kalman_filter.h:40
Eigen::Matrix< double, p, 1 > z_t
Measurement vector type .
Definition: kalman_filter.h:36
typename Eigen::Matrix< double, p, w > Z_t
Measurement sigma points matrix.
Definition: ukf.h:51
Helper struct for passing around the state and its covariance in one variable.
Definition: kalman_filter.h:47
Implementation of the Unscented Kalman filter .
Definition: ukf.h:39
is thrown when taking the inverse of a matrix fails during kalman gain calculation
Definition: ukf.h:89
This abstract class defines common interfaces and types for a generic Kalman filter.
Definition: kalman_filter.h:26