Skip to content

Commit

Permalink
perf(behavior_path_planner): improve getOverlappedLaneletId (autoware…
Browse files Browse the repository at this point in the history
…foundation#10094)

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
  • Loading branch information
soblin authored Feb 11, 2025
1 parent 9aa61e6 commit d962acb
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,20 +662,15 @@ std::optional<size_t> getOverlappedLaneletId(const std::vector<DrivableLanes> &
return {};
}

size_t overlapped_idx = lanes.size();
for (size_t i = 0; i < lanes.size() - 2; ++i) {
for (size_t j = i + 2; j < lanes.size(); ++j) {
if (overlaps(lanes.at(i), lanes.at(j))) {
overlapped_idx = std::min(overlapped_idx, j);
return j;
}
}
}

if (overlapped_idx == lanes.size()) {
return {};
}

return overlapped_idx;
return {};
}

std::vector<DrivableLanes> cutOverlappedLanes(
Expand Down

0 comments on commit d962acb

Please sign in to comment.