From 3cf0481b9b796d1a2dd325601467f5f98cd509ab Mon Sep 17 00:00:00 2001 From: Mamoru Sobue Date: Thu, 12 Oct 2023 18:35:24 +0900 Subject: [PATCH] fix(intersection): fix unsigned subtraction (#5280) Signed-off-by: Mamoru Sobue --- planning/behavior_velocity_intersection_module/src/util.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/planning/behavior_velocity_intersection_module/src/util.cpp b/planning/behavior_velocity_intersection_module/src/util.cpp index 7862a533f34eb..ffc0b61880188 100644 --- a/planning/behavior_velocity_intersection_module/src/util.cpp +++ b/planning/behavior_velocity_intersection_module/src/util.cpp @@ -475,6 +475,9 @@ std::optional getFirstPointInsidePolygon( if (is_in_lanelet) { return std::make_optional(i); } + if (i == 0) { + break; + } } } return std::nullopt; @@ -517,6 +520,9 @@ getFirstPointInsidePolygons( if (is_in_lanelet) { break; } + if (i == 0) { + break; + } } } return std::nullopt;