Skip to content

Commit

Permalink
fix(behavior_path_planner_common): prevent duplicated point insertion…
Browse files Browse the repository at this point in the history
… in cutOverlappedLanes (autowarefoundation#9363)

Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 authored Nov 20, 2024
1 parent a4a5749 commit 2ac579f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,13 @@ std::vector<DrivableLanes> cutOverlappedLanes(
}

// Step2. pick up only path points within drivable lanes
std::set<size_t> path_point_indices;
for (const auto & drivable_lanes : shorten_lanes) {
for (size_t i = start_point_idx; i < original_points.size(); ++i) {
if (is_point_in_drivable_lanes(drivable_lanes, original_points.at(i))) {
path.points.push_back(original_points.at(i));
const auto & p = original_points.at(i);
if (is_point_in_drivable_lanes(drivable_lanes, p) && path_point_indices.count(i) == 0) {
path.points.push_back(p);
path_point_indices.insert(i);
continue;
}
start_point_idx = i;
Expand Down

0 comments on commit 2ac579f

Please sign in to comment.