Function calculate_virtual_cones_for_both_sides

Function Documentation

std::tuple<arma::fmat, arma::ivec, arma::ivec, arma::fmat, arma::ivec, arma::ivec> calculate_virtual_cones_for_both_sides(const arma::fmat &left_cones, const arma::fmat &right_cones, const arma::fvec &car_position, const arma::fvec &car_direction, float min_track_width, float major_radius, float minor_radius, float max_search_angle)

Calculates the virtual cones for both sides of the track.

This function computes virtual cones for both the left and right sides of the track based on the provided cone positions, car position, direction, and geometric parameters. It returns the resulting virtual cones and their corresponding match indices for both sides.

Parameters:
  • left_cones – A matrix of left side cone positions (N x 2).

  • right_cones – A matrix of right side cone positions (M x 2).

  • car_position – A vector representing the car position in the track (2D).

  • car_direction – A vector representing the direction the car is facing (2D).

  • min_track_width – The minimum track width to consider when placing virtual cones.

  • major_radius – The major radius of the cones.

  • minor_radius – The minor radius of the cones.

  • max_search_angle – The maximum search angle allowed for matching cones.

Returns:

A tuple containing:

  • Left side result cones (N x 2).

  • Left side match indices (1D array of matches).

  • Right side result cones (M x 2).

  • Right side match indices (1D array of matches).