Skip to content

Commit 1750f37

Browse files
committed
improve doxygen
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com> update docs Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
1 parent 9dac569 commit 1750f37

File tree

2 files changed

+40
-20
lines changed
  • planning/behavior_path_planner/autoware_behavior_path_planner_common

2 files changed

+40
-20
lines changed

planning/behavior_path_planner/autoware_behavior_path_planner_common/include/autoware/behavior_path_planner_common/utils/path_safety_checker/safety_check.hpp

+40-19
Original file line numberDiff line numberDiff line change
@@ -252,32 +252,53 @@ double calc_obstacle_min_length(const Shape & shape);
252252
double calc_obstacle_max_length(const Shape & shape);
253253

254254
/**
255-
* @brief Calculate collision roughly by comparing minimum/maximum distance with margin.
256-
* @param path The path of the ego vehicle.
257-
* @param objects The predicted objects.
258-
* @param min_margin_threshold threshold for collision check when the minimum distance between ego
259-
* @param max_margin_threshold threshold for collision check when the maximum distance between ego
260-
* @param parameters The common parameters used in behavior path planner.
261-
* @param use_offset_ego_point If true, the closest point to the object is calculated by
262-
* interpolating the path points.
263-
* @return Collision (rough) between minimum distance and maximum distance
255+
* @brief Performs efficient rough collision check between ego vehicle and objects
256+
* @details
257+
* This function calculates two types of distances between ego vehicle and each object:
258+
* - Minimum distance: The shortest possible distance between ego and object when positioned
259+
* diagonally with their corners closest to each other (uses maximum extent of both objects)
260+
* - Maximum distance: The largest possible distance between ego and object when positioned parallel
261+
* to each other (uses minimum extent of both objects)
262+
*
263+
* A collision is detected when:
264+
* - min_distance < min_margin_threshold (first element of returned pair is true)
265+
* - max_distance < max_margin_threshold (second element of returned pair is true)
266+
*
267+
* This approach provides a computationally efficient rough collision check that can be used
268+
* before performing more expensive precise collision check algorithms.
269+
* @param path The path of the ego vehicle
270+
* @param objects The predicted objects to check for collision
271+
* @param min_margin_threshold Threshold for minimum distance collision check
272+
* @param max_margin_threshold Threshold for maximum distance collision check
273+
* @param parameters The common parameters used in behavior path planner
274+
* @param use_offset_ego_point If true, uses interpolated point on path closest to object
275+
* @return A pair of boolean values {min_distance_collision, max_distance_collision}
264276
*/
265277
std::pair<bool, bool> checkObjectsCollisionRough(
266278
const PathWithLaneId & path, const PredictedObjects & objects, const double min_margin_threshold,
267279
const double max_margin_threshold, const BehaviorPathPlannerParameters & parameters,
268280
const bool use_offset_ego_point);
269281

270282
/**
271-
* @brief Calculate the rough distances between the path and the objects and return the minimum
272-
* @param path The path of the ego vehicle.
273-
* @param objects The predicted objects.
274-
* @param parameters The common parameters used in behavior path planner.
275-
* @param use_offset_ego_point If true, the closest point to the object is calculated by
276-
* interpolating the path points.
277-
* @param distance_type The type of distance to calculate. "min" or "max". Calculate the distance
278-
* when the distance is minimized or maximized when the direction of the ego and the object is
279-
* changed.
280-
* @return The rough distance between the ego vehicle and the objects.
283+
* @brief Calculate the shortest rough distance between ego vehicle and objects based on specific
284+
* orientation cases
285+
* @details
286+
* This function calculates a rough estimate of the closest distance between the ego vehicle's path
287+
* and objects by considering two specific orientation cases:
288+
* - "min": Uses the maximum extents of both ego and object (diagonal orientation case)
289+
* This calculates the worst-case, shortest possible distance when objects are oriented to
290+
* minimize the gap between them (when corners face each other)
291+
* - "max": Uses the minimum extents of both ego and object (parallel orientation case)
292+
* This calculates the best-case, longest possible distance when objects are oriented to
293+
* maximize the gap between them (when sides are parallel)
294+
* @param path The path of the ego vehicle
295+
* @param objects The predicted objects to calculate distance to
296+
* @param parameters The common parameters used in behavior path planner
297+
* @param use_offset_ego_point If true, uses interpolated point on path closest to object for more
298+
* accurate calculation
299+
* @param distance_type Either "min" or "max" to specify which orientation case to calculate
300+
* @return The shortest rough distance between the ego vehicle and any object for the specified
301+
* orientation case
281302
*/
282303
double calculateRoughDistanceToObjects(
283304
const PathWithLaneId & path, const PredictedObjects & objects,

planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_safety_checker/safety_check.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,6 @@ double calculateRoughDistanceToObjects(
882882
double shortest_distance_from_ego_footprint_to_objects_on_path(
883883
const PathWithLaneId & path, const PredictedObjects & objects,
884884
const BehaviorPathPlannerParameters & parameters, const bool use_offset_ego_pose)
885-
886885
{
887886
const auto & p = parameters;
888887
double min_distance = std::numeric_limits<double>::max();

0 commit comments

Comments
 (0)