Skip to content

Commit

Permalink
fix(no_stopping_area): fix stopping in front of a no stopping area in…
Browse files Browse the repository at this point in the history
… parking on the shoulder (#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>
  • Loading branch information
kaigohirao and pre-commit-ci[bot] authored Feb 29, 2024
1 parent c36e2ef commit 144b9c7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon(
}
++ego_area_start_idx;
}
if (ego_area_start_idx > num_ignore_nearest) {
ego_area_start_idx--;
}

if (!is_in_area) {
return ego_area;
}
Expand All @@ -338,6 +336,11 @@ Polygon2d NoStoppingAreaModule::generateEgoNoStoppingAreaLanePolygon(
const auto & p = pp.at(i).point.pose.position;
if (!bg::within(Point2d{p.x, p.y}, lanelet::utils::to2D(no_stopping_area).basicPolygon())) {
dist_from_area_sum += tier4_autoware_utils::calcDistance2d(pp.at(i), pp.at(i - 1));

// do not take extra distance and exit as soon as p is outside no stopping area
// just a temporary fix
ego_area_end_idx = i - 1;
break;
}
if (dist_from_start_sum > extra_dist || dist_from_area_sum > margin) {
break;
Expand Down

0 comments on commit 144b9c7

Please sign in to comment.