-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(avoidance): use intersection area #4206
feat(avoidance): use intersection area #4206
Conversation
54cc40b
to
e6c69d0
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4206 +/- ##
==========================================
+ Coverage 14.16% 14.18% +0.01%
==========================================
Files 1586 1586
Lines 109537 109417 -120
Branches 31451 31391 -60
==========================================
+ Hits 15518 15519 +1
+ Misses 77130 77015 -115
+ Partials 16889 16883 -6
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
e6c69d0
to
0c21706
Compare
|
||
// expand drivable area by intersection areas. | ||
const std::string id = bound_lane.attributeOr("intersection_area", "else"); | ||
if (enable_expanding_intersection_areas && id != "else") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bool isIntersectionArea = enable_expanding_intersection_areas && intersection_area != "else";
// expand drivable area by intersection areas.
if (isIntersectionArea) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your advice! I fixed in 1e60bcb.
if (use_hatched_road_markings) { | ||
for (const auto & point : target_line) { | ||
const auto new_polygon_candidate = | ||
utils::getPolygonByPoint(rh, point, "hatched_road_markings"); | ||
if (!new_polygon_candidate) { | ||
continue; | ||
} | ||
|
||
bool is_new_polygon{true}; | ||
for (const auto & polygon : expandable_polygons) { | ||
if (polygon.id() == new_polygon_candidate->id()) { | ||
is_new_polygon = false; | ||
break; | ||
} | ||
} | ||
|
||
if (is_new_polygon) { | ||
expandable_polygons.push_back(*new_polygon_candidate); | ||
} | ||
} | ||
} | ||
|
||
if (use_intersection_areas) { | ||
const std::string area_id_str = overhang_lanelet.attributeOr("intersection_area", "else"); | ||
|
||
if (is_new_polygon) { | ||
expandable_polygons.push_back(*new_polygon_candidate); | ||
if (area_id_str != "else") { | ||
expandable_polygons.push_back( | ||
rh->getLaneletMapPtr()->polygonLayer.get(std::atoi(area_id_str.c_str()))); | ||
} | ||
} | ||
|
||
if (expandable_polygons.empty()) { | ||
return to_road_shoulder_distance; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto polygonExistsIn = [](const auto &polygons, const auto &new_polygon) {
return std::any_of(polygons.begin(), polygons.end(), [&](const auto &polygon){
return polygon.id() == new_polygon.id();
});
};
if (use_hatched_road_markings) {
for (const auto & point : target_line) {
const auto new_polygon_candidate = utils::getPolygonByPoint(rh, point, "hatched_road_markings");
if (new_polygon_candidate && !polygonExistsIn(expandable_polygons, *new_polygon_candidate)) {
expandable_polygons.push_back(*new_polygon_candidate);
}
}
}
if (use_intersection_areas) {
const std::string area_id_str = overhang_lanelet.attributeOr("intersection_area", "else");
if (area_id_str != "else") {
expandable_polygons.push_back(
rh->getLaneletMapPtr()->polygonLayer.get(std::atoi(area_id_str.c_str())));
}
}
if (expandable_polygons.empty()) {
return to_road_shoulder_distance;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed in 1e60bcb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(suggest a minor modification but it's not necessarly condidered.)
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
0c21706
to
1e60bcb
Compare
…4206) Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Description
🤖 Generated by Copilot at 48eabc2
This pull request refactors and improves the code for generating and using the drivable area in the behavior path planner. It removes redundant code, adds new parameters and flags, and simplifies the logic for expanding the drivable area by polygons such as hatched road markings and intersection areas. It also makes the functions for drivable area calculation more consistent and flexible. The changes affect several files in the
planning/behavior_path_planner
directory, such asutils.hpp
,utils.cpp
,planner_manager.cpp
, andavoidance.param.yaml
.Please approve ⬇️ before this PR.
autowarefoundation/autoware_launch#439
Tests performed
Psim
Effects on system behavior
Not applicable.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.