Class ConeSorting

Class Documentation

class ConeSorting

Public Functions

ConeSorting()

Constructor for the ConeSorting class.

void initialize(const bool &use_unknown_cones, const int &max_n_neighbors, const int &max_length, const float &max_dist, const float &max_dist_to_car, const float &max_dist_to_neighbor, const float &threshold_directional_angle, const float &threshold_absolute_angle, const float &threshold_other_side_angle, const float &threshold_filter_angle)

Initializes parameters for sorting cones.

Parameters:
  • use_unknown_cones – Whether to use unknown cones.

  • max_n_neighbors – Maximum number of neighbors.

  • max_length – Maximum length.

  • max_dist – Maximum distance.

  • max_dist_to_car – Maximum distance to car.

  • max_dist_to_neighbor – Maximum distance to the neighbor cone.

  • threshold_directional_angle – Threshold for directional angle.

  • threshold_absolute_angle – Threshold for absolute angle.

  • threshold_other_side_angle – Threshold for the other side angle.

  • threshold_filter_angle – Threshold for filtering cones in between.

std::pair<std::vector<int>, std::vector<int>> run_cone_sorting(const std::array<float, 2> car_position, const std::array<float, 2> car_direction, const std::vector<std::array<float, 3>> cones)

Run the sorting algorithm for cones.

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.

Returns:

A pair of vectors containing the sorted right and left cone configurations in order.