Skip to content

Commit 30d4643

Browse files
StepTurtleMehmet Dogru
authored and
Mehmet Dogru
committed
Fix
Signed-off-by: Barış Zeren <bzeren1819@gmail.com>
1 parent c312952 commit 30d4643

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

map/map_loader/src/lanelet2_map_loader/lanelet2_differential_loader_module.cpp

+3-18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ bool Lanelet2DifferentialLoaderModule::differentialLanelet2Load(
9797
}
9898
}
9999

100+
lanelet::utils::overwriteLaneletsCenterline(map, 5.0, false);
101+
100102
const auto map_bin_msg =
101103
Lanelet2MapLoaderNode::create_map_bin_msg(map, lanelet2_paths[0], rclcpp::Clock().now());
102104

@@ -113,24 +115,7 @@ bool Lanelet2DifferentialLoaderModule::differentialLanelet2Load(
113115
}
114116
}
115117

116-
// overwrite local_x, local_y
117-
for (lanelet::Point3d point : map->pointLayer) {
118-
if (point.hasAttribute("local_x")) {
119-
point.x() = point.attribute("local_x").asDouble().value();
120-
}
121-
if (point.hasAttribute("local_y")) {
122-
point.y() = point.attribute("local_y").asDouble().value();
123-
}
124-
}
125-
126-
// realign lanelet borders using updated points
127-
for (lanelet::Lanelet lanelet : map->laneletLayer) {
128-
auto left = lanelet.leftBound();
129-
auto right = lanelet.rightBound();
130-
std::tie(left, right) = lanelet::geometry::align(left, right);
131-
lanelet.setLeftBound(left);
132-
lanelet.setRightBound(right);
133-
}
118+
lanelet::utils::overwriteLaneletsCenterline(map, 5.0, false);
134119

135120
const auto map_bin_msg =
136121
Lanelet2MapLoaderNode::create_map_bin_msg(map, lanelet2_paths[0], rclcpp::Clock().now());

0 commit comments

Comments
 (0)