mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
This class implements the partially norm-constrained linear Kalman filter [5]. More...
#include <nckf.h>
Public Types | |
using | Base_class = NCLKF< n, m, p > |
Base class of this class. | |
using | x_t = typename Base_class::x_t |
State vector type . | |
using | u_t = typename Base_class::u_t |
Input vector type . | |
using | z_t = typename Base_class::z_t |
Measurement vector type . | |
using | P_t = typename Base_class::P_t |
State uncertainty covariance matrix type . | |
using | R_t = typename Base_class::R_t |
Measurement noise covariance matrix type . | |
using | Q_t = typename Base_class::Q_t |
Process noise covariance matrix type . | |
using | statecov_t = typename Base_class::statecov_t |
Helper struct for passing around the state and its covariance in one variable. | |
using | A_t = typename Base_class::A_t |
System transition matrix type . | |
using | B_t = typename Base_class::B_t |
Input to state mapping matrix type . | |
using | H_t = typename Base_class::H_t |
State to measurement mapping matrix type . | |
using | K_t = typename Base_class::K_t |
Kalman gain matrix type . | |
using | indices_t = std::array< int, nq > |
Indices of the norm-constrained states type. | |
using | xq_t = Eigen::Matrix< double, nq, 1 > |
Norm-constrained states vector type . | |
using | Hq_t = Eigen::Matrix< double, p, nq > |
Norm-constrained measurement mapping type . | |
using | Kq_t = Eigen::Matrix< double, nq, p > |
Norm-constrained kalman gain type . | |
Public Types inherited from mrs_lib::NCLKF< n_states, n_inputs, n_measurements > | |
using | Base_class = LKF< n, m, p > |
Base class of this class. | |
using | x_t = typename Base_class::x_t |
State vector type . | |
using | u_t = typename Base_class::u_t |
Input vector type . | |
using | z_t = typename Base_class::z_t |
Measurement vector type . | |
using | P_t = typename Base_class::P_t |
State uncertainty covariance matrix type . | |
using | R_t = typename Base_class::R_t |
Measurement noise covariance matrix type . | |
using | Q_t = typename Base_class::Q_t |
Process noise covariance matrix type . | |
using | statecov_t = typename Base_class::statecov_t |
Helper struct for passing around the state and its covariance in one variable. | |
using | A_t = typename Base_class::A_t |
System transition matrix type . | |
using | B_t = typename Base_class::B_t |
Input to state mapping matrix type . | |
using | H_t = typename Base_class::H_t |
State to measurement mapping matrix type . | |
using | K_t = typename Base_class::K_t |
Kalman gain matrix type . | |
Public Types inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
using | Base_class = KalmanFilter< n, m, p > |
Base class of this class. | |
using | x_t = typename Base_class::x_t |
State vector type . | |
using | u_t = typename Base_class::u_t |
Input vector type . | |
using | z_t = typename Base_class::z_t |
Measurement vector type . | |
using | P_t = typename Base_class::P_t |
State uncertainty covariance matrix type . | |
using | R_t = typename Base_class::R_t |
Measurement noise covariance matrix type . | |
using | Q_t = typename Base_class::Q_t |
Process noise covariance matrix type . | |
using | statecov_t = typename Base_class::statecov_t |
Helper struct for passing around the state and its covariance in one variable. | |
typedef Eigen::Matrix< double, n, n > | A_t |
System transition matrix type . | |
typedef Eigen::Matrix< double, n, m > | B_t |
Input to state mapping matrix type . | |
typedef Eigen::Matrix< double, p, n > | H_t |
State to measurement mapping matrix type . | |
typedef Eigen::Matrix< double, n, p > | K_t |
Kalman gain matrix type . | |
Public Types inherited from mrs_lib::KalmanFilter< n_states, n_inputs, n_measurements > | |
typedef Eigen::Matrix< double, n, 1 > | x_t |
State vector type . | |
typedef Eigen::Matrix< double, m, 1 > | u_t |
Input vector type . | |
typedef Eigen::Matrix< double, p, 1 > | z_t |
Measurement vector type . | |
typedef Eigen::Matrix< double, n, n > | P_t |
State uncertainty covariance matrix type . | |
typedef Eigen::Matrix< double, p, p > | R_t |
Measurement noise covariance matrix type . | |
typedef Eigen::Matrix< double, n, n > | Q_t |
Process noise covariance matrix type . | |
Public Member Functions | |
NCLKF_partial () | |
Convenience default constructor. More... | |
NCLKF_partial (const A_t &A, const B_t &B, const H_t &H, const double l, const indices_t &norm_constrained_indices) | |
The main constructor. More... | |
Public Member Functions inherited from mrs_lib::NCLKF< n_states, n_inputs, n_measurements > | |
NCLKF () | |
Convenience default constructor. More... | |
NCLKF (const A_t &A, const B_t &B, const H_t &H, const double l) | |
The main constructor. More... | |
Public Member Functions inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
LKF () | |
Convenience default constructor. More... | |
LKF (const A_t &A, const B_t &B, const H_t &H) | |
The main constructor. More... | |
virtual statecov_t | correct (const statecov_t &sc, const z_t &z, const R_t &R) const override |
Applies the correction (update, measurement, data) step of the Kalman filter. More... | |
virtual statecov_t | predict (const statecov_t &sc, const u_t &u, const Q_t &Q, [[maybe_unused]] double dt) const override |
Applies the prediction (time) step of the Kalman filter. More... | |
Public Member Functions inherited from mrs_lib::KalmanFilter< n_states, n_inputs, n_measurements > | |
virtual statecov_t | correct (const statecov_t &sc, const z_t &z, const R_t &R) const =0 |
Applies the correction (update, measurement, data) step of the Kalman filter. More... | |
virtual statecov_t | predict (const statecov_t &sc, const u_t &u, const Q_t &Q, double dt) const =0 |
Applies the prediction (time) step of the Kalman filter. More... | |
Static Public Attributes | |
static const int | n = n_states |
Length of the state vector of the system. | |
static const int | m = n_inputs |
Length of the input vector of the system. | |
static const int | p = n_measurements |
Length of the measurement vector of the system. | |
static const int | nq = n_norm_constrained_states |
Number of states to which the norm constraint applies. | |
Static Public Attributes inherited from mrs_lib::NCLKF< n_states, n_inputs, n_measurements > | |
static const int | n = n_states |
Length of the state vector of the system. | |
static const int | m = n_inputs |
Length of the input vector of the system. | |
static const int | p = n_measurements |
Length of the measurement vector of the system. | |
Static Public Attributes inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
static constexpr int | n = n_states |
Length of the state vector of the system. | |
static constexpr int | m = n_inputs |
Length of the input vector of the system. | |
static constexpr int | p = n_measurements |
Length of the measurement vector of the system. | |
Static Public Attributes inherited from mrs_lib::KalmanFilter< n_states, n_inputs, n_measurements > | |
static const int | n = n_states |
Length of the state vector of the system. | |
static const int | m = n_inputs |
Length of the input vector of the system. | |
static const int | p = n_measurements |
Length of the measurement vector of the system. | |
Protected Member Functions | |
virtual K_t | computeKalmanGain (const statecov_t &sc, const z_t &z, const R_t &R, const H_t &H) const override |
Protected Member Functions inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
virtual K_t | computeKalmanGain (const statecov_t &sc, [[maybe_unused]] const z_t &z, const R_t &R, const H_t &H) const |
statecov_t ::type | correction_impl (const statecov_t &sc, const z_t &z, const R_t &R, const H_t &H) const |
Additional Inherited Members | |
Public Attributes inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
A_t | A |
The system transition matrix . | |
B_t | B |
The input to state mapping matrix . | |
H_t | H |
The state to measurement mapping matrix . | |
Static Protected Member Functions inherited from mrs_lib::LKF< n_states, n_inputs, n_measurements > | |
static P_t | covariance_predict (const A_t &A, const P_t &P, const Q_t &Q, const double dt) |
template<int check = n_inputs> | |
static std::enable_if< check==0, x_t >::type | state_predict (const A_t &A, const x_t &x, [[maybe_unused]] const B_t &B, [[maybe_unused]] const u_t &u) |
template<int check = n_inputs> | |
static std::enable_if< check !=0, x_t >::type | state_predict (const A_t &A, const x_t &x, const B_t &B, const u_t &u) |
static R_t | invert_W (R_t W) |
Protected Attributes inherited from mrs_lib::NCLKF< n_states, n_inputs, n_measurements > | |
double | l |
This class implements the partially norm-constrained linear Kalman filter [5].
Note that the class is templated. The template parameters specify the number of states, number of inputs and number of measurements of the system. The last template parameter specifies the number of states which are norm-constrained.
The norm constraint is specified in the constructor together with the indices of the states to which the constraint applies.
Example usage:
|
inline |
Convenience default constructor.
This constructor should not be used if applicable. If used, the main constructor has to be called afterwards, before using this class, otherwise the object is invalid (not initialized).
|
inline |
The main constructor.
A | State transition matrix of the system (n x n). |
B | Input to state mapping matrix of the system (n x m). |
H | State to measurement mapping matrix of the system (p x n). |
l | The norm constraint, applied to the specified states. |
norm_constrained_indices | Indices of the norm-constrained states in the state vector. |