Skip to content

Commit 9aa220a

Browse files
committed
Simplify calculate_other_lanelets
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
1 parent d04d71e commit 9aa220a

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

planning/behavior_velocity_out_of_lane_module/src/lanelets_selection.cpp

+1-14
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,12 @@ lanelet::ConstLanelets calculate_other_lanelets(
6969
const auto lanelets_within_range = lanelet::geometry::findWithin2d(
7070
route_handler.getLaneletMapPtr()->laneletLayer, ego_point,
7171
std::max(params.slow_dist_threshold, params.stop_dist_threshold));
72-
const auto is_overlapped_by_path_lanelets = [&](const auto & l) {
73-
for (const auto & path_ll : path_lanelets) {
74-
if (
75-
boost::geometry::overlaps(
76-
path_ll.polygon2d().basicPolygon(), l.polygon2d().basicPolygon()) ||
77-
boost::geometry::within(path_ll.polygon2d().basicPolygon(), l.polygon2d().basicPolygon()) ||
78-
boost::geometry::within(l.polygon2d().basicPolygon(), path_ll.polygon2d().basicPolygon())) {
79-
return true;
80-
}
81-
}
82-
return false;
83-
};
8472
for (const auto & ll : lanelets_within_range) {
8573
if (std::string(ll.second.attributeOr(lanelet::AttributeName::Subtype, "none")) != "road")
8674
continue;
8775
const auto is_path_lanelet = contains_lanelet(path_lanelets, ll.second.id());
8876
const auto is_ignored_lanelet = contains_lanelet(ignored_lanelets, ll.second.id());
89-
if (!is_path_lanelet && !is_ignored_lanelet && !is_overlapped_by_path_lanelets(ll.second))
90-
other_lanelets.push_back(ll.second);
77+
if (!is_path_lanelet && !is_ignored_lanelet) other_lanelets.push_back(ll.second);
9178
}
9279
return other_lanelets;
9380
}

0 commit comments

Comments
 (0)