Skip to content

Commit 5617f74

Browse files
beyzanurkayabeyza
and
beyza
authored
fix(predicted_path_checker): check if trajectory size (autowarefoundation#6730)
check trajectory size Signed-off-by: beyza <bnk@leodrive.ai> Co-authored-by: beyza <bnk@leodrive.ai>
1 parent 1aa5bb9 commit 5617f74

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

control/predicted_path_checker/src/predicted_path_checker_node/predicted_path_checker_node.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ void PredictedPathCheckerNode::filterObstacles(
537537
const Pose & ego_pose, const TrajectoryPoints & traj, const double dist_threshold,
538538
const bool use_prediction, PredictedObjects & filtered_objects)
539539
{
540+
if (traj.size() < 2) {
541+
RCLCPP_ERROR(rclcpp::get_logger("predicted_path_checker"), "Trajectory size is less than 2.");
542+
return;
543+
}
540544
filtered_objects.header.frame_id = object_ptr_.get()->header.frame_id;
541545
filtered_objects.header.stamp = this->now();
542546

0 commit comments

Comments
 (0)