Function calculate_cones_for_other_side
Defined in File functional_cone_matching.hpp
Function Documentation
-
std::tuple<arma::fmat, arma::ivec, arma::ivec> calculate_cones_for_other_side(const arma::fmat &cones, ConeType cone_type, float major_radius, float minor_radius, float max_search_angle, const arma::fmat &other_side_cones, float min_track_width, const arma::fvec &car_pos, const arma::fvec &car_dir)
Calculates cones for the other side of the track by matching them with cones on the given side.
This function matches cones from one side of the track to cones on the other side and creates virtual cones for those without a match. The cones are then combined and sorted.
- Parameters:
cones – A matrix of cone positions on the current side of the track (N x 2).
cone_type – The type of cones (either LEFT or RIGHT).
major_radius – The major radius of the cones.
minor_radius – The minor radius of the cones.
max_search_angle – The maximum angle allowed when searching for matches.
other_side_cones – A matrix of cone positions on the opposite side of the track (M x 2).
min_track_width – The minimum width of the track.
car_pos – The current car position (2D).
car_dir – The current car direction (2D).
- Returns:
A pair containing:
Combined and sorted cones (N x 2).
Mask indicating which cones are virtual (1D array).