Skip to content
Snippets Groups Projects

fix: modify downsampling condition

1 unresolved thread
8 files
+ 204
20
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -108,7 +108,18 @@ map_api::Lane::Polyline MantleMapConverter::CreateCenterLineGeometry(
if (config_.downsampling)
{
center_line = DecimatePolyline(center_line.begin(), center_line.end(), config_.downsampling_epsilon.value());
if (center_line.size() < 2)
{
std::cout << "[RoadLogicSuite] WARN: The size of center line points in road " << road.id
<< " section start " << section.s_start << " lane " << lane_id << " is less than 2,"
<< " downsampling is skipped, "
<< "please check corresponding center line in map file!" << std::endl;
}
else
{
center_line =
DecimatePolyline(center_line.begin(), center_line.end(), config_.downsampling_epsilon.value());
}
}
return center_line;
@@ -279,19 +290,26 @@ std::unique_ptr<map_api::LaneBoundary> MantleMapConverter::CreateBoundary(const
}
}
if (s_end == section.s_end)
if (auto boundary_point =
utils::CreateBoundaryPointAt(converter, s_end, t_offset, road.id, road_mark, section, lane_id))
{
if (auto boundary_point =
utils::CreateBoundaryPointAt(converter, s_end, t_offset, road.id, road_mark, section, lane_id))
{
boundary_points.push_back(boundary_point.value());
}
boundary_points.push_back(boundary_point.value());
}
if (config_.downsampling)
{
boundary_points =
DecimatePolyline(boundary_points.begin(), boundary_points.end(), config_.downsampling_epsilon.value());
if (boundary_points.size() < 2)
{
std::cout << "[RoadLogicSuite] WARN: The size of boundary points in road " << road.id << " section start "
<< section.s_start << " lane " << lane_id << " is less than 2,"
<< " downsampling is skipped, "
<< "please check corresponding roadmarks in map file!" << std::endl;
}
else
{
boundary_points =
DecimatePolyline(boundary_points.begin(), boundary_points.end(), config_.downsampling_epsilon.value());
}
}
if (lane_id > 0)
{
Loading