Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0bd9a99

Browse files
beyzanurkayabeyza
authored andcommittedApr 5, 2024
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 ac1cd43 commit 0bd9a99

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)
Please sign in to comment.