|
using | x_t = typename Model::x_t |
| State vector type .
|
|
using | u_t = typename Model::u_t |
| Input vector type .
|
|
using | z_t = typename Model::z_t |
| Measurement vector type .
|
|
using | P_t = typename Model::P_t |
| State uncertainty covariance matrix type .
|
|
using | R_t = typename Model::R_t |
| Measurement noise covariance matrix type .
|
|
using | Q_t = typename Model::Q_t |
| Process noise covariance matrix type .
|
|
using | statecov_t = typename Model::statecov_t |
| Helper struct for passing around the state and its covariance in one variable.
|
|
using | ModelPtr = typename std::shared_ptr< Model > |
| Shorthand type for a shared pointer-to-Model.
|
|
|
template<bool check = disable_reprediction> |
std::enable_if_t<!check, statecov_t > | predictTo (const ros::Time &to_stamp) |
| Estimates the system state and covariance matrix at the specified time. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t< check, statecov_t > | predictTo (const ros::Time &to_stamp) |
| Estimates the system state and covariance matrix at the specified time. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t<!check > | addInputChangeWithNoise (const u_t &u, const Q_t &Q, const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t< check > | addInputChangeWithNoise (const u_t &u, const Q_t &Q, [[maybe_unused]] const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t<!check > | addInputChange (const u_t &u, const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t< check > | addInputChange (const u_t &u, [[maybe_unused]] const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t<!check > | addProcessNoiseChange (const Q_t &Q, const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t< check > | addProcessNoiseChange (const Q_t &Q, [[maybe_unused]] const ros::Time &stamp, const ModelPtr &model=nullptr) |
| Adds one system input to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t<!check > | addMeasurement (const z_t &z, const R_t &R, const ros::Time &stamp, const ModelPtr &model=nullptr, const double &meas_id=-1) |
| Adds one measurement to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
template<bool check = disable_reprediction> |
std::enable_if_t< check > | addMeasurement (const z_t &z, const R_t &R, const ros::Time &stamp, const ModelPtr &model=nullptr, const double &meas_id=-1) |
| Adds one measurement to the history buffer, removing the oldest element in the buffer if it is full. More...
|
|
| Repredictor (const x_t &x0, const P_t &P0, const u_t &u0, const Q_t &Q0, const ros::Time &t0, const ModelPtr &model, const unsigned hist_len) |
| The main constructor. More...
|
|
| Repredictor () |
| Empty constructor. More...
|
|
| Repredictor (const x_t &x0, const P_t &P0, const Q_t &Q0, const ros::Time &t0, const ModelPtr &model, const unsigned hist_len) |
| Variation of the constructor for cases without a system input. More...
|
|
template<class Model, bool disable_reprediction = false>
class mrs_lib::Repredictor< Model, disable_reprediction >
Implementation of the Repredictor for fusing measurements with variable delays.
A standard state-space system model is assumed for the repredictor with system inputs and measurements, generated from the system state vector. The inputs and measurements may be delayed with varying durations (an older measurement may become available after a newer one). A typical use-case scenario is when you have one "fast" but imprecise sensor and one "slow" but precise sensor and you want to use them both to get a good prediction (eg. height from the Garmin LiDAR, which comes at 100Hz, and position from a SLAM, which comes at 10Hz with a long delay). If the slow sensor is significantly slower than the fast one, fusing its measurement at the time it arrives without taking into account the sensor's delay may significantly bias your latest estimate.
To accomodate this, the Repredictor keeps a buffer of N last inputs and measurements (N is specified in the constructor). This buffer is then used to re-predict the desired state to a specific time, as requested by the user. Note that the re-prediction is evaluated in a lazy manner only when the user requests it, so it goes through the whole history buffer every time a prediction is requested.
The Repredictor utilizes a fusion Model (specified as the template parameter), which should implement the predict() and correct() methods. This Model is used for fusing the system inputs and measurements as well as for predictions. Typically, this Model will be some kind of a Kalman Filter (LKF, UKF etc.).
- Note
- The Model should be able to accomodate predictions with varying time steps in order for the Repredictor to work correctly (see eg. the varstepLKF class).
- Template Parameters
-
Model | the prediction and correction model (eg. a Kalman Filter). |
disable_reprediction | if true, reprediction is disabled and the class will act like a dumb LKF (for evaluation purposes). |
- Examples
- repredictor/example.cpp.