Class ConeMatching
Defined in File cone_matching.hpp
Class Documentation
-
class ConeMatching
Class for matching cones on both sides of the track.
This class is responsible for finding virtual cones on both sides of the track based on a set of given parameters (such as track width and maximum search parameters). The matching process considers cones on both sides of the track, calculates virtual cones where necessary, and returns matching results in terms of cone positions and match indices.
Public Functions
-
ConeMatching()
Constructor for the ConeMatching class.
-
void initialize(const float &min_track_width, const float &max_search_range, const float &max_search_angle)
Initializes the cone matching system with sorted cones and SLAM position and direction.
- Parameters:
min_track_width – Minimum track width.
max_search_range – Maximum search range for matching cones.
max_search_angle – Maximum search angle for matching cones.
-
std::tuple<std::vector<std::vector<float>>, std::vector<std::vector<float>>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>> run_cone_matching(const std::array<float, 2> car_position, const std::array<float, 2> car_direction, const std::vector<std::array<float, 2>> cones, std::vector<int> left_configuration, std::vector<int> right_configuration)
Runs the cone matching algorithm for both sides and returns the matched virtual cones and their indices.
This method calculates virtual cones for both the left and right sides of the track, then matches cones on the left side to cones on the right side and vice versa. It returns the cones along with match indices for each side.
- Parameters:
car_position – Position of the car (x, y).
car_direction – Direction of the car (x, y).
cones_by_type – Vector of cones sorted by type.
left_configuration – Vector of left cone configurations.
right_configuration – Vector of right cone configurations.
- Returns:
A tuple containing:
Left cones with virtual cones included.
Right cones with virtual cones included.
Match indices for left to right matching.
Match indices for right to left matching.
Virtual mask for left cones.
Virtual mask for right cones.
-
ConeMatching()