From 84fee4edc4ed9ef8879eae2945b48f5a60c0a282 Mon Sep 17 00:00:00 2001 From: Maxime CLEMENT Date: Mon, 25 Dec 2023 17:32:19 +0900 Subject: [PATCH] Update docstring and small code cleanup Signed-off-by: Maxime CLEMENT --- .../drivable_area_expansion/drivable_area_expansion.hpp | 2 +- .../drivable_area_expansion/drivable_area_expansion.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/drivable_area_expansion/drivable_area_expansion.hpp b/planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/drivable_area_expansion/drivable_area_expansion.hpp index e2849cae4e431..7e4cf94c890d8 100644 --- a/planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/drivable_area_expansion/drivable_area_expansion.hpp +++ b/planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/drivable_area_expansion/drivable_area_expansion.hpp @@ -75,7 +75,7 @@ void apply_arc_length_range_smoothing( Expansion & expansion, const std::vector & bound, const double arc_length_range, const Side side); -/// @brief calculate mappings between path poses and the given drivable area bound +/// @brief calculate minimum lane widths and mappings between path and and drivable area bounds /// @param [in] path_poses path poses /// @param [in] left_bound left drivable area bound /// @param [in] right_bound right drivable area bound diff --git a/planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp b/planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp index 8a8b8a5447a12..da7f0fbb327d7 100644 --- a/planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp +++ b/planning/behavior_path_planner_common/src/utils/drivable_area_expansion/drivable_area_expansion.cpp @@ -222,9 +222,9 @@ std::vector calculate_maximum_distance( const auto segment_vector = segment_ls.second - segment_ls.first; const auto is_point_on_correct_side = [&](const Point2d & p) { const auto point_vector = p - segment_ls.first; - return (segment_vector.x() * point_vector.y() - segment_vector.y() * point_vector.x()) * - (side == LEFT ? -1.0 : 1.0) <= - 0.0; + const auto cross_product = + (segment_vector.x() * point_vector.y() - segment_vector.y() * point_vector.x()); + return cross_product * (side == LEFT ? -1.0 : 1.0) <= 0.0; }; const auto is_on_correct_side = [&](const Segment2d & segment) { return is_point_on_correct_side(segment.first) || is_point_on_correct_side(segment.second);