Skip to content
Snippets Groups Projects

fix: fix road barrier conversion issue

All threads resolved!
Files
6
@@ -40,13 +40,21 @@ std::unique_ptr<map_api::LaneBoundary> MantleBarrierConverter::Convert(const std
}
const auto position = converter
.ConvertRoadPositionToInertialCoordinates(
{.road = road_id, .s_offset = barrier.s_end, .t_offset = barrier.t_end})
.value();
points.push_back({
.position = {position.x, position.y, position.z + barrier.z_offset_end},
{.road = road_id, .s_offset = barrier.s_end, .t_offset = barrier.t_end});
if (position.has_value())
{
points.push_back({
.position = {position.value().x, position.value().y, position.value().z + barrier.z_offset_end},
.width = barrier.width_end,
.height = barrier.height_end,
});
});
}
else
{
std::cout << "WARNING: Invalid s_end value of road barrier with road id " << road_id << " is discarded in conversion!" << std::endl;
}
if (config.downsampling)
{
points = DecimatePolyline(points.begin(), points.end(), config.downsampling_epsilon.value());
Loading