Skip to content

Commit 2ac579f

Browse files
authored
fix(behavior_path_planner_common): prevent duplicated point insertion in cutOverlappedLanes (#9363)
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
1 parent a4a5749 commit 2ac579f

File tree

1 file changed

+5
-2
lines changed
  • planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/drivable_area_expansion

1 file changed

+5
-2
lines changed

planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/drivable_area_expansion/static_drivable_area.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,13 @@ std::vector<DrivableLanes> cutOverlappedLanes(
729729
}
730730

731731
// Step2. pick up only path points within drivable lanes
732+
std::set<size_t> path_point_indices;
732733
for (const auto & drivable_lanes : shorten_lanes) {
733734
for (size_t i = start_point_idx; i < original_points.size(); ++i) {
734-
if (is_point_in_drivable_lanes(drivable_lanes, original_points.at(i))) {
735-
path.points.push_back(original_points.at(i));
735+
const auto & p = original_points.at(i);
736+
if (is_point_in_drivable_lanes(drivable_lanes, p) && path_point_indices.count(i) == 0) {
737+
path.points.push_back(p);
738+
path_point_indices.insert(i);
736739
continue;
737740
}
738741
start_point_idx = i;

0 commit comments

Comments
 (0)