Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
JCBB Class Reference

Data association implementation that uses the Malhanobis Distance only as criterion to make observation matches. More...

#include <jcbb.hpp>

Inheritance diagram for JCBB:
Inheritance graph
Collaboration diagram for JCBB:
Collaboration graph

Public Member Functions

 JCBB (const DataAssociationParameters &params)
 
 ~JCBB ()=default
 
Eigen::VectorXi associate (const Eigen::VectorXd &landmarks, const Eigen::VectorXd &observations, const Eigen::MatrixXd &covariance, const Eigen::VectorXd &observation_confidences) const override
 Perform data association using the Joint Compatibility Branch & Bound algorithm.
 
- Public Member Functions inherited from DataAssociationModel
virtual int associate_n_filter (const std::vector< common_lib::structures::Cone > &perception_map, Eigen::VectorXf &_x_vector_, Eigen::MatrixXf &_p_matrix_, std::vector< int > &matched_ids, std::vector< Eigen::Vector2f > &matched_cone_positions, std::vector< Eigen::Vector2f > &new_features, ObservationModel *observation_model) const =0
 Associate the observed landmarks to the expected landmarks and update the state vector and the covariance matrix.
 
 DataAssociationModel (float max_landmark_distance)
 
virtual ~DataAssociationModel ()=default
 
 DataAssociationModel ()=default
 
 DataAssociationModel (DataAssociationParameters params)
 
virtual ~DataAssociationModel ()=default
 

Private Member Functions

void search_branch_and_bound (int current_obs_idx, int num_observations, int num_landmarks, const Eigen::MatrixXd &distances, Eigen::VectorXi &current_hypothesis, Eigen::VectorXi &best_hypothesis, double &best_score, double current_score) const
 Recursive branch and bound search to find the best hypothesis.
 
bool is_landmark_already_assigned (const Eigen::VectorXi &hypothesis, int landmark_idx) const
 Check if a landmark is already assigned in the current hypothesis.
 

Additional Inherited Members

- Protected Member Functions inherited from DataAssociationModel
float get_max_landmark_distance () const
 
- Protected Attributes inherited from DataAssociationModel
DataAssociationParameters _params_
 

Detailed Description

Data association implementation that uses the Malhanobis Distance only as criterion to make observation matches.

Definition at line 17 of file jcbb.hpp.

Constructor & Destructor Documentation

◆ JCBB()

JCBB::JCBB ( const DataAssociationParameters params)
inline

Definition at line 45 of file jcbb.hpp.

◆ ~JCBB()

JCBB::~JCBB ( )
default

Member Function Documentation

◆ associate()

Eigen::VectorXi JCBB::associate ( const Eigen::VectorXd &  landmarks,
const Eigen::VectorXd &  observations,
const Eigen::MatrixXd &  covariance,
const Eigen::VectorXd &  observation_confidences 
) const
overridevirtual

Perform data association using the Joint Compatibility Branch & Bound algorithm.

This function finds the most consistent assignment of 2D observations to known 2D landmarks by maximizing the number of mutually compatible pairs. Uses Euclidean distance as the compatibility measure and a branch & bound search to efficiently explore the space of hypotheses.

Parameters
landmark_positionsLandmark positions in format [x1, y1, x2, y2, ...].
observation_positionsObservation positions in format [x1, y1, x2, y2, ...].
covarianceCovariance matrix of state estimate (unused in this version).
observation_confidencesConfidences for each observation (unused in this version).
Returns
Eigen::VectorXi of size num_observations:
  • If element i >= 0 → index of associated landmark.
  • If element i == -1 → observation is unassigned (new/clutter).

Implements DataAssociationModel.

Definition at line 3 of file jcbb.cpp.

Here is the call graph for this function:

◆ is_landmark_already_assigned()

bool JCBB::is_landmark_already_assigned ( const Eigen::VectorXi &  hypothesis,
int  landmark_idx 
) const
private

Check if a landmark is already assigned in the current hypothesis.

Parameters
hypothesisCurrent hypothesis vector.
landmark_idxIndex of the landmark to check.
Returns
true if landmark is already assigned, false otherwise.

Definition at line 84 of file jcbb.cpp.

Here is the caller graph for this function:

◆ search_branch_and_bound()

void JCBB::search_branch_and_bound ( int  current_obs_idx,
int  num_observations,
int  num_landmarks,
const Eigen::MatrixXd &  distances,
Eigen::VectorXi &  current_hypothesis,
Eigen::VectorXi &  best_hypothesis,
double &  best_score,
double  current_score 
) const
private

Recursive branch and bound search to find the best hypothesis.

Parameters
current_obs_idxIndex of the observation being processed.
num_observationsTotal number of observations.
num_landmarksTotal number of landmarks.
distancesPrecomputed Euclidean distances between observations and landmarks.
current_hypothesisCurrent hypothesis (partial).
best_hypothesisBest hypothesis found so far (output).
best_scoreBest score found so far (output).
current_scoreScore of the current partial hypothesis.

Definition at line 33 of file jcbb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: