Skip to main content

StateEstimation::IFilter

StateEstimation::IFilter

Abstract interface for a state estimation filter. More…

#include <IFilter.hpp>

Inherited by StateEstimation::KalmanFilterT< Eigen::Dynamic, Eigen::Dynamic >, StateEstimation::KalmanFilterT< StateDim, MeasDim >

Public Functions

Name
virtual ~IFilter() =default
virtual void initialize(FilterState const & initial_state) =0
Initializes the filter with an initial state.
virtual FilterState predict() =0
Predicts the next state based on the internal motion model.
virtual FilterState update(FilterState const & predicted_state, Measurement const & measurement) =0
Updates (corrects) the filter’s state based on a new measurement.
virtual FilterState update(FilterState const & predicted_state, Measurement const & measurement, double noise_scale_factor) =0
Updates the filter’s state with scaled measurement noise.
virtual FilterState getState() const =0
Gets the current state of the filter.
virtual std::vector< FilterState > smooth(std::vector< FilterState > const & forward_states) =0
Performs Rauch-Tung-Striebel (RTS) smoothing on a sequence of states.
virtual std::unique_ptr< IFilter > clone() const =0
Clones the filter object.

Detailed Description

class StateEstimation::IFilter;

Abstract interface for a state estimation filter.

This class defines the contract for all filter implementations, such as KalmanFilter, ExtendedKalmanFilter (EKF), or UnscentedKalmanFilter (UKF). It operates on generic feature vectors, keeping it decoupled from specific data types (like Lines or Points).

Public Functions Documentation

function ~IFilter

virtual ~IFilter() =default

function initialize

virtual void initialize(
    FilterState const & initial_state
) =0

Initializes the filter with an initial state.

Parameters:

  • initial_state The starting state (mean and covariance) of the object to be tracked.

Reimplemented by: StateEstimation::KalmanFilterT::initialize, StateEstimation::KalmanFilterT::initialize

function predict

virtual FilterState predict() =0

Predicts the next state based on the internal motion model.

Return: The predicted state (prior estimate).

Reimplemented by: StateEstimation::KalmanFilterT::predict, StateEstimation::KalmanFilterT::predict

function update

virtual FilterState update(
    FilterState const & predicted_state,
    Measurement const & measurement
) =0

Updates (corrects) the filter’s state based on a new measurement.

Parameters:

  • predicted_state The state predicted by the most recent call to [predict()](/api_generated/Classes/classStateEstimation_1_1IFilter.md#function-predict).
  • measurement The new observation, converted into a feature vector.

Return: The updated (corrected) state (posterior estimate).

Reimplemented by: StateEstimation::KalmanFilterT::update, StateEstimation::KalmanFilterT::update

function update

virtual FilterState update(
    FilterState const & predicted_state,
    Measurement const & measurement,
    double noise_scale_factor
) =0

Updates the filter’s state with scaled measurement noise.

Parameters:

  • predicted_state The state predicted by the most recent call to [predict()](/api_generated/Classes/classStateEstimation_1_1IFilter.md#function-predict).
  • measurement The new observation, converted into a feature vector.
  • noise_scale_factor Factor to scale the measurement noise matrix R.

Return: The updated (corrected) state (posterior estimate).

Reimplemented by: StateEstimation::KalmanFilterT::update, StateEstimation::KalmanFilterT::update

function getState

virtual FilterState getState() const =0

Gets the current state of the filter.

Return: The current state (posterior estimate).

Reimplemented by: StateEstimation::KalmanFilterT::getState, StateEstimation::KalmanFilterT::getState

function smooth

virtual std::vector< FilterState > smooth(
    std::vector< FilterState > const & forward_states
) =0

Performs Rauch-Tung-Striebel (RTS) smoothing on a sequence of states.

Parameters:

  • forward_states A vector of state estimates from the forward pass, ordered chronologically. This should include both predicted and updated states as required by the RTS algorithm.

Return: A vector of smoothed FilterState objects, one for each corresponding input state.

Reimplemented by: StateEstimation::KalmanFilterT::smooth, StateEstimation::KalmanFilterT::smooth

This method takes a history of states from a forward Kalman filter pass and recursively computes a more accurate, smoothed estimate for the entire sequence.

function clone

virtual std::unique_ptr< IFilter > clone() const =0

Clones the filter object.

Return: A std::unique_ptr to a new instance of the filter with the same configuration.

Reimplemented by: StateEstimation::KalmanFilterT::clone, StateEstimation::KalmanFilterT::clone

This is essential for the Tracker, which will hold a “prototype” filter and clone it for each new group that needs to be tracked.


Updated on 2026-11-13 at 20:25:41 +0000