Skip to content

Commit

Permalink
fix(static_drivable_area_expansion): fix bug in expansion logic for h…
Browse files Browse the repository at this point in the history
…atched road marking (autowarefoundation#5842) (#1075)

fix(utils): fix drivable area expansion logic for zebra zone

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Dec 18, 2023
1 parent ae04fa1 commit c5b6dc8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions planning/behavior_path_planner/src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,8 @@ std::vector<lanelet::ConstPoint3d> getBoundWithHatchedRoadMarkings(
} else {
if (!polygon) {
will_close_polygon = true;
} else if (polygon.value().id() != current_polygon.value().id()) {
will_close_polygon = true;
} else {
current_polygon_border_indices.push_back(
get_corresponding_polygon_index(*current_polygon, bound_point.id()));
Expand Down Expand Up @@ -1620,6 +1622,17 @@ std::vector<lanelet::ConstPoint3d> getBoundWithHatchedRoadMarkings(
(*current_polygon)[mod(target_poly_idx, current_polygon_points_num)]);
}
}

if (polygon.has_value() && current_polygon.has_value()) {
if (polygon.value().id() != current_polygon.value().id()) {
current_polygon = polygon;
current_polygon_border_indices.clear();
current_polygon_border_indices.push_back(
get_corresponding_polygon_index(current_polygon.value(), bound_point.id()));
continue;
}
}

current_polygon = std::nullopt;
current_polygon_border_indices.clear();
}
Expand Down

0 comments on commit c5b6dc8

Please sign in to comment.