Function find_obstacles

Function Documentation

std::vector<Obstacle> find_obstacles(const std::vector<float> &ranges, float obstacle_threshold_gain, float hysteresis, float inverse_res, float car_width)

Identifies and returns a list of obstacles based on range data.

This function processes a vector of range data to detect obstacles. It uses a threshold to determine the presence of obstacles and applies hysteresis to avoid noise. The function can use either a fixed threshold or a dynamically calculated threshold based on the mean of the range data.

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

  • obstacle_threshold_gain – Gain factor for dynamic threshold calculation.

  • hysteresis – Hysteresis value to avoid noise in obstacle detection.

  • inverse_res – Inverse of the proportionality constant for obstacle width calculation [1/deg].

  • car_width – Width of the car for obstacle width calculation.

Returns:

std::vector<Obstacle> A vector of detected obstacles.