Skip to content

Commit

Permalink
fix(utils): add guard
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota committed Oct 12, 2023
1 parent ee1574a commit add619c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion planning/behavior_path_planner/src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ std::vector<lanelet::ConstPoint3d> getBoundWithIntersectionAreas(
const auto shared_point_itr_last =
std::find_if(expanded_bound.rbegin(), expanded_bound.rend(), [&](const auto & p) {
return std::any_of(
intersection_bound.begin(), intersection_bound.end(),
intersection_bound.rbegin(), intersection_bound.rend(),
[&](const auto & point) { return point.id() == p.id(); });
});

Expand All @@ -1757,6 +1757,13 @@ std::vector<lanelet::ConstPoint3d> getBoundWithIntersectionAreas(
continue;
}

// TODO(Satoshi OTA): remove this guard.
if (
std::distance(intersection_bound.begin(), trim_point_itr_last) <
std::distance(intersection_bound.begin(), trim_point_itr_init)) {
continue;
}

std::vector<lanelet::ConstPoint3d> tmp_bound{};

tmp_bound.insert(tmp_bound.end(), expanded_bound.begin(), shared_point_itr_init);
Expand Down

0 comments on commit add619c

Please sign in to comment.