Function max_index

Function Documentation

int max_index(const std::vector<float> &ranges, float inverse_res, float field_resolution)

Finds the index of the maximum value in a vector of ranges and scales it.

This function iterates through a vector of float values (ranges) to find the index of the maximum value. It then scales this index to find the corresponding inside the field.

Parameters:
  • ranges – A vector of float values representing the ranges.

  • inverse_res – A float value representig the inverse of the ranges resolution [1/deg].

  • field_resolution – A float value representing the resolution of the field.

Returns:

The scaled index of the maximum value in the ranges vector.