Skip to content

Commit dcb6b10

Browse files
fix out of range access
Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp>
1 parent 6fb0beb commit dcb6b10

File tree

1 file changed

+8
-0
lines changed
  • planning/obstacle_cruise_planner/src

1 file changed

+8
-0
lines changed

planning/obstacle_cruise_planner/src/node.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,14 @@ std::optional<SlowDownObstacle> ObstacleCruisePlannerNode::createSlowDownObstacl
11811181
if (id == 0) {
11821182
continue;
11831183
}
1184+
1185+
if (!route_handler_->getLaneletMapPtr()->polygonLayer.exists(id)) {
1186+
RCLCPP_DEBUG(
1187+
rclcpp::get_logger("ObstacleCruisePlanner"),
1188+
"Specified Lanelet polygon id [%ld] is not exsit in the map", id);
1189+
continue;
1190+
}
1191+
11841192
const auto intersection_poly =
11851193
lanelet::utils::to2D(route_handler_->getLaneletMapPtr()->polygonLayer.get(id))
11861194
.basicPolygon();

0 commit comments

Comments
 (0)