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)

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

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored and karishma1911 committed May 28, 2024
1 parent 436b380 commit 7f5cb5a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,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 @@ -1217,6 +1219,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 7f5cb5a

Please sign in to comment.