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

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

#include <nearest_neighbor.hpp>

Inheritance diagram for NearestNeighbor:
Inheritance graph
Collaboration diagram for NearestNeighbor:
Collaboration graph

Public Member Functions

 NearestNeighbor (const DataAssociationParameters &params)
 
 ~NearestNeighbor ()=default
 
Eigen::VectorXi associate (const Eigen::VectorXd &landmarks, const Eigen::VectorXd &observations, const Eigen::MatrixXd &covariance, const Eigen::VectorXd &observation_confidences) const override
 This function associates the landmarks with the observations.
 
- 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
 

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 13 of file nearest_neighbor.hpp.

Constructor & Destructor Documentation

◆ NearestNeighbor()

NearestNeighbor::NearestNeighbor ( const DataAssociationParameters params)

Definition at line 6 of file nearest_neighbor.cpp.

◆ ~NearestNeighbor()

NearestNeighbor::~NearestNeighbor ( )
default

Member Function Documentation

◆ associate()

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

This function associates the landmarks with the observations.

Parameters
landmarksLandmarks in the form of [x1, y1, x2, y2, ...] in the global frame
observationsObservations in the form of [x1, y1, x2, y2, ...] in the global frame
covarianceCovariance matrix of the landmark vector
observation_confidencesConfidence in the observations in the same order as the observations
Returns
Eigen::VectorXi Each entry corresponds to an observation and contains the index of the landmark that the observation is associated with in the landmark vector (x coordinate). If the observation is considered new, the entry is -1. If the observation is considered an outlier, the entry is -2.

Implements DataAssociationModel.

Definition at line 16 of file nearest_neighbor.cpp.

Here is the caller graph for this function:

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