@@ -85,29 +85,37 @@ PathWithNoDrivableLanePolygonIntersection getPathIntersectionWithNoDrivableLaneP
85
85
bg::within (first_path_point, polygon);
86
86
auto const & is_last_path_point_inside_polygon = bg::within (last_path_point, polygon);
87
87
88
- if (
89
- intersects.empty () &&
90
- path_no_drivable_lane_polygon_intersection.is_first_path_point_inside_polygon &&
91
- is_last_path_point_inside_polygon) {
92
- path_no_drivable_lane_polygon_intersection.is_path_inside_of_polygon = true ;
93
- } else {
94
- // classify first and second intersection points
95
- for (size_t i = 0 ; i < intersects.size (); ++i) {
96
- const auto & p = intersects.at (i);
97
- if (
98
- (intersects.size () == 2 && i == 0 ) ||
99
- (intersects.size () == 1 && is_last_path_point_inside_polygon)) {
100
- path_no_drivable_lane_polygon_intersection.first_intersection_point =
101
- createPoint (p.x (), p.y (), ego_pos.z );
102
- } else if (
103
- (intersects.size () == 2 && i == 1 ) ||
104
- (intersects.size () == 1 &&
105
- path_no_drivable_lane_polygon_intersection.is_first_path_point_inside_polygon )) {
106
- path_no_drivable_lane_polygon_intersection.second_intersection_point =
107
- createPoint (p.x (), p.y (), ego_pos.z );
108
- }
88
+ if (intersects.empty ()) {
89
+ if (
90
+ path_no_drivable_lane_polygon_intersection.is_first_path_point_inside_polygon &&
91
+ is_last_path_point_inside_polygon) {
92
+ path_no_drivable_lane_polygon_intersection.is_path_inside_of_polygon = true ;
93
+ } else {
94
+ // do nothing
95
+ }
96
+ } else if (intersects.size () == 1 ) {
97
+ const auto & p = intersects.at (0 );
98
+ if (is_last_path_point_inside_polygon) {
99
+ path_no_drivable_lane_polygon_intersection.first_intersection_point =
100
+ createPoint (p.x (), p.y (), ego_pos.z );
101
+ } else if (path_no_drivable_lane_polygon_intersection.is_first_path_point_inside_polygon ) {
102
+ path_no_drivable_lane_polygon_intersection.second_intersection_point =
103
+ createPoint (p.x (), p.y (), ego_pos.z );
104
+ } else {
105
+ // do nothing
109
106
}
107
+ } else if (intersects.size () == 2 ) {
108
+ // classify first and second intersection points
109
+ const auto & p0 = intersects.at (0 );
110
+ const auto & p1 = intersects.at (1 );
111
+ path_no_drivable_lane_polygon_intersection.first_intersection_point =
112
+ createPoint (p0.x (), p0.y (), ego_pos.z );
113
+ path_no_drivable_lane_polygon_intersection.second_intersection_point =
114
+ createPoint (p1.x (), p1.y (), ego_pos.z );
115
+ } else {
116
+ // do nothing
110
117
}
118
+
111
119
return path_no_drivable_lane_polygon_intersection;
112
120
}
113
121
} // namespace autoware::behavior_velocity_planner
0 commit comments