Skip to main content

StateEstimation::HungarianAssigner

StateEstimation::HungarianAssigner

An implementation of IAssigner that uses the Hungarian algorithm. More…

#include <HungarianAssigner.hpp>

Inherits from StateEstimation::IAssigner

Public Functions

Name
HungarianAssigner(double max_assignment_distance, Eigen::MatrixXd const & measurement_matrix, Eigen::MatrixXd const & measurement_noise_covariance, std::string feature_name =“composite_features”)
Constructs a HungarianAssigner.
virtual Assignment solve(std::vector< Prediction > const & predictions, std::vector< Observation > const & observations, std::map< EntityId, FeatureCache > const & feature_cache) override
Solves the assignment problem for a set of predictions and observations.
virtual double getCostThreshold() const override
virtual std::unique_ptr< IAssigner > clone() const override
Clones the assigner object.

Additional inherited members

Public Functions inherited from StateEstimation::IAssigner

Name
virtual ~IAssigner() =default

Detailed Description

class StateEstimation::HungarianAssigner;

An implementation of IAssigner that uses the Hungarian algorithm.

This class calculates a cost matrix based on the Mahalanobis distance between predicted states and observed measurements. It then uses the Hungarian algorithm to find the optimal assignment with the minimum total cost.

Public Functions Documentation

function HungarianAssigner

HungarianAssigner(
    double max_assignment_distance,
    Eigen::MatrixXd const & measurement_matrix,
    Eigen::MatrixXd const & measurement_noise_covariance,
    std::string feature_name ="composite_features"
)

Constructs a HungarianAssigner.

Parameters:

  • max_assignment_distance The maximum allowable Mahalanobis distance for an assignment to be considered valid.
  • measurement_matrix (H) The matrix that maps the state space to the measurement space.
  • measurement_noise_covariance (R) The covariance of the measurement noise.
  • feature_name The name of the feature to extract from the cache for distance calculation (e.g., “position”).

function solve

virtual Assignment solve(
    std::vector< Prediction > const & predictions,
    std::vector< Observation > const & observations,
    std::map< EntityId, FeatureCache > const & feature_cache
) override

Solves the assignment problem for a set of predictions and observations.

Parameters:

  • predictions A vector of predicted states from the filter for each active track.
  • observations A vector of new, unassigned observations from the current frame.
  • feature_cache A map where the key is an EntityId from an observation and the value is a cache of its pre-calculated features. The assigner uses this to retrieve the feature vectors it needs for its cost matrix calculation.

Return: An Assignment object detailing the successful matches.

Reimplements: StateEstimation::IAssigner::solve

function getCostThreshold

inline virtual double getCostThreshold() const override

Reimplements: StateEstimation::IAssigner::getCostThreshold

function clone

virtual std::unique_ptr< IAssigner > clone() const override

Clones the assigner object.

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

Reimplements: StateEstimation::IAssigner::clone


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