Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions common/autoware_lanelet2_utils/src/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,15 @@ std::optional<lanelet::ConstLanelet> combine_lanelets_shape(const lanelet::Const
}

const auto combined_lanelet_opt = create_safe_lanelet(lefts, rights);
assert(combined_lanelet_opt.has_value() && "lefts or rights bound size is less than 2.");
if (!combined_lanelet_opt.has_value()) {
return std::nullopt;
}
auto combined_lanelet = remove_const(*combined_lanelet_opt);

const auto center_line_opt = create_safe_linestring(centers);
assert(center_line_opt.has_value() && "centers size is less than 2.");
if (!center_line_opt.has_value()) {
return std::nullopt;
}
const auto center_line = remove_const(*center_line_opt);

combined_lanelet.setCenterline(center_line);
Expand Down
Loading