Skip to content

Commit

Permalink
fix(obstacle_avoidance_planner): add error handling of empty referenc…
Browse files Browse the repository at this point in the history
…e point (tier4#1072)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 authored and boyali committed Oct 19, 2022
1 parent 06f1089 commit dde66d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions planning/obstacle_avoidance_planner/src/mpt_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ std::vector<ReferencePoint> MPTOptimizer::getReferencePoints(
traj_param_.num_sampling_points * mpt_param_.delta_arc_length_for_mpt_points +
tmp_ref_points_margin;
ref_points = points_utils::clipForwardPoints(ref_points, 0, ref_length_with_margin);
if (ref_points.empty()) {
return std::vector<ReferencePoint>{};
}

// set bounds information
calcBounds(ref_points, enable_avoidance, maps, prev_trajs, debug_data_ptr);
Expand Down

0 comments on commit dde66d7

Please sign in to comment.