Function find_disparities

Function Documentation

void find_disparities(std::vector<float> ranges, std::vector<float> &processed_ranges, float car_width, float max_range, float angle_increment, float lidar_fov, float desired_fov, float disparity_thrashold, float r_multiplier)

Processes LIDAR range data to extend disparities and clip ranges.

This function processes raw LIDAR range data to extend disparities and clip the ranges to a maximum value. It identifies disparities in the range data and extends them. Find the disparities such that the absolute value of the difference between two subsequent rays is greater than disparity_thrashold. For every disparity, calculate the angle theta corresponding to the number of lidar radius to be leveled R. Then, choose the minimum between the two rays that generated the disparity and level R rays starting from the minimum one and going in the opposite direction of the maximum one.

Parameters:
  • ranges – A vector of raw LIDAR range data.

  • processed_ranges – A reference to a vector where the processed range data will be stored.

  • car_width – The width of the car.

  • max_range – The maximum range value to clip the LIDAR data.

  • angle_increment – The angular increment between consecutive LIDAR measurements.

  • lidar_fov – The field of view of the LIDAR sensor.

  • desired_fov – The desired field of view to process.

  • disparity_thrashold – The threshold to identify disparities in the range data.

  • r_multiplier – A multiplier to extend the number of rays to cut.

Throws:

std::runtime_error – if the calculated angle theta is negative.