From fc7063d318c7fd259ee2663a3fed9cce2a9ce561 Mon Sep 17 00:00:00 2001 From: Takayuki Murooka Date: Mon, 17 Jun 2024 12:22:09 +0900 Subject: [PATCH] Update tmp/lanelet2_extension/lib/utilities.cpp Co-authored-by: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> --- tmp/lanelet2_extension/lib/utilities.cpp | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tmp/lanelet2_extension/lib/utilities.cpp b/tmp/lanelet2_extension/lib/utilities.cpp index 884ed752..bb5bd24b 100644 --- a/tmp/lanelet2_extension/lib/utilities.cpp +++ b/tmp/lanelet2_extension/lib/utilities.cpp @@ -508,21 +508,20 @@ void overwriteLaneletsCenterline( if (force_overwrite) { const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); lanelet_obj.setCenterline(fine_center_line); - } else { - if (use_waypoints) { - if (lanelet_obj.hasCustomCenterline()) { - const auto & centerline = lanelet_obj.centerline(); - lanelet_obj.setAttribute("waypoints", centerline.id()); - } - - const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); - lanelet_obj.setCenterline(fine_center_line); - } else { - if (!lanelet_obj.hasCustomCenterline()) { - const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); - lanelet_obj.setCenterline(fine_center_line); - } + if (force_overwrite) { + const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); + lanelet_obj.setCenterline(fine_center_line); + } else if (use_waypoints) { + if (lanelet_obj.hasCustomCenterline()) { + const auto & centerline = lanelet_obj.centerline(); + lanelet_obj.setAttribute("waypoints", centerline.id()); } + + const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); + lanelet_obj.setCenterline(fine_center_line); + } else if (!lanelet_obj.hasCustomCenterline()) { + const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); + lanelet_obj.setCenterline(fine_center_line); } } }