From 1c2bba928099be25d1838b4da6004a1627d2d8f6 Mon Sep 17 00:00:00 2001 From: Yuki TAKAGI <141538661+yuki-takagi-66@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:30:52 +0900 Subject: [PATCH] fix(obstacle_stop): add vector size guard (#6254) * add guard Signed-off-by: Yuki Takagi --- planning/obstacle_stop_planner/src/node.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/planning/obstacle_stop_planner/src/node.cpp b/planning/obstacle_stop_planner/src/node.cpp index 050c4af55c9bf..3bdfd67a7bec4 100644 --- a/planning/obstacle_stop_planner/src/node.cpp +++ b/planning/obstacle_stop_planner/src/node.cpp @@ -1548,6 +1548,8 @@ void ObstacleStopPlannerNode::filterObstacles( const PredictedObjects & input_objects, const Pose & ego_pose, const TrajectoryPoints & traj, const double dist_threshold, PredictedObjects & filtered_objects) { + if (traj.size() < 2) return; + filtered_objects.header = input_objects.header; for (auto & object : input_objects.objects) {