Commit 63b9769 1 parent 5d79c9a commit 63b9769 Copy full SHA for 63b9769
File tree 1 file changed +9
-4
lines changed
planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
#include < autoware/universe_utils/geometry/geometry.hpp>
18
18
19
+ #include < boost/geometry/algorithms/detail/disjoint/interface.hpp>
20
+
21
+ #include < lanelet2_core/geometry/BoundingBox.h>
19
22
#include < lanelet2_core/geometry/LaneletMap.h>
20
23
#include < lanelet2_routing/RoutingGraph.h>
21
24
@@ -71,10 +74,12 @@ lanelet::ConstLanelets calculate_trajectory_lanelets(
71
74
lanelet::BasicLineString2d trajectory_ls;
72
75
for (const auto & p : ego_data.trajectory_points )
73
76
trajectory_ls.emplace_back (p.pose .position .x , p.pose .position .y );
74
- for (const auto & dist_lanelet :
75
- lanelet::geometry::findWithin2d (lanelet_map_ptr->laneletLayer , trajectory_ls)) {
76
- if (!contains_lanelet (trajectory_lanelets, dist_lanelet.second .id ()))
77
- trajectory_lanelets.push_back (dist_lanelet.second );
77
+ const auto candidates =
78
+ lanelet_map_ptr->laneletLayer .search (lanelet::geometry::boundingBox2d (trajectory_ls));
79
+ for (const auto & ll : candidates) {
80
+ if (!boost::geometry::disjoint (trajectory_ls, ll.polygon2d ().basicPolygon ())) {
81
+ trajectory_lanelets.push_back (ll);
82
+ }
78
83
}
79
84
const auto missing_lanelets =
80
85
get_missing_lane_change_lanelets (trajectory_lanelets, route_handler);
You can’t perform that action at this time.
0 commit comments