Skip to content

Commit 56e8640

Browse files
kaigohiraopre-commit-ci[bot]
authored andcommitted
fix(no_stopping_area): fix stopping in front of a no stopping area in parking on the shoulder (autowarefoundation#6517)
* fix stopping in front of a no stopping area in ego vehicle parking on the shoulder * style(pre-commit): autofix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2d970fd commit 56e8640

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

planning/behavior_velocity_no_stopping_area_module/src/scene_no_stopping_area.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon(
324324
}
325325
++ego_area_start_idx;
326326
}
327-
if (ego_area_start_idx > num_ignore_nearest) {
328-
ego_area_start_idx--;
329-
}
327+
330328
if (!is_in_area) {
331329
return ego_area;
332330
}
@@ -338,6 +336,11 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon(
338336
const auto & p = pp.at(i).point.pose.position;
339337
if (!bg::within(Point2d{p.x, p.y}, lanelet::utils::to2D(no_stopping_area).basicPolygon())) {
340338
dist_from_area_sum += tier4_autoware_utils::calcDistance2d(pp.at(i), pp.at(i - 1));
339+
340+
// do not take extra distance and exit as soon as p is outside no stopping area
341+
// just a temporary fix
342+
ego_area_end_idx = i - 1;
343+
break;
341344
}
342345
if (dist_from_start_sum > extra_dist || dist_from_area_sum > margin) {
343346
break;

0 commit comments

Comments
 (0)