From e6bb7773fa25656b17962cd71e5de5ec8a1a068c Mon Sep 17 00:00:00 2001 From: h-ohta Date: Thu, 12 Oct 2023 20:26:00 +0900 Subject: [PATCH] add error handling --- planning/obstacle_avoidance_planner/src/node.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/planning/obstacle_avoidance_planner/src/node.cpp b/planning/obstacle_avoidance_planner/src/node.cpp index eb75fcbee9006..c5f642ebb7973 100644 --- a/planning/obstacle_avoidance_planner/src/node.cpp +++ b/planning/obstacle_avoidance_planner/src/node.cpp @@ -1093,6 +1093,9 @@ void ObstacleAvoidancePlanner::calcVelocity( const std::vector & path_points, std::vector & traj_points) const { + if (path_points.size() < 2) { + return; + } for (size_t i = 0; i < traj_points.size(); i++) { const size_t nearest_seg_idx = [&]() { const auto opt_seg_idx = tier4_autoware_utils::findNearestSegmentIndex(