From b5e0d3def440a8f3fec22cff0ccf4154d307116c Mon Sep 17 00:00:00 2001 From: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:05:58 +0900 Subject: [PATCH] fix(behavior_path_planner): prevent crashes with the drivable area expansion (#917) --- .../src/utils/drivable_area_expansion/expansion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planning/behavior_path_planner/src/utils/drivable_area_expansion/expansion.cpp b/planning/behavior_path_planner/src/utils/drivable_area_expansion/expansion.cpp index 828fdc2f17a51..8fe8b12252aea 100644 --- a/planning/behavior_path_planner/src/utils/drivable_area_expansion/expansion.cpp +++ b/planning/behavior_path_planner/src/utils/drivable_area_expansion/expansion.cpp @@ -64,7 +64,7 @@ polygon_t createExpansionPolygon( boost::geometry::buffer( base_ls, polygons, distance_strategy, strategy::side_straight(), strategy::join_miter(), strategy::end_flat(), strategy::point_square()); - return polygons.front(); + return polygons.empty() ? polygon_t{} : polygons.front(); } std::array calculate_arc_length_range_and_distance(