Skip to content
Snippets Groups Projects

feat: post converter for lanegroup

Merged Ziqi Zhou requested to merge ziqi/road-logic-suite:dev/post-converter-lanegroup into main
1 unresolved thread
Files
7
@@ -61,6 +61,28 @@ void MantleMapConverter::ConvertRoad(const Road& road, const OpenDriveData& data
std::make_move_iterator(center_boundaries_right.begin()),
std::make_move_iterator(center_boundaries_right.end()));
std::move(right_lanes.begin(), right_lanes.end(), std::back_inserter(map_.lanes));
// Create lane_group and set this in map_api::map
std::unique_ptr<map_api::LaneGroup> lane_group = std::make_unique<map_api::LaneGroup>();
lane_group->id = id_provider_lane_group_.GetNewId();
lane_group->type = utils::IsJunction(road.road_assigned_junction_id) ? map_api::LaneGroup::Type::kJunction
: map_api::LaneGroup::Type::kOneWay;
auto ref_right_lanes = utils::GetLanesRefs(right_lanes);
lane_group->lanes.insert(lane_group->lanes.end(),
std::make_move_iterator(ref_right_lanes.begin()),
std::make_move_iterator(ref_right_lanes.end()));
auto ref_center_boundaries_right = utils::GetLaneBoundariesRefs(center_boundaries_right);
lane_group->lane_boundaries.insert(lane_group->lane_boundaries.end(),
std::make_move_iterator(ref_center_boundaries_right.begin()),
std::make_move_iterator(ref_center_boundaries_right.end()));
auto ref_lane_boundaries = utils::GetLaneBoundariesRefs(lane_boundaries);
lane_group->lane_boundaries.insert(lane_group->lane_boundaries.end(),
std::make_move_iterator(ref_lane_boundaries.begin()),
std::make_move_iterator(ref_lane_boundaries.end()));
map_.lane_groups.push_back(std::move(lane_group));
}
is_left_side = true;
@@ -80,6 +102,29 @@ void MantleMapConverter::ConvertRoad(const Road& road, const OpenDriveData& data
std::make_move_iterator(center_boundaries_left.end()));
std::move(left_lanes.begin(), left_lanes.end(), std::back_inserter(map_.lanes));
// Create lane_group and set this in map_api::map
std::unique_ptr<map_api::LaneGroup> lane_group = std::make_unique<map_api::LaneGroup>();
lane_group->id = id_provider_lane_group_.GetNewId();
lane_group->type = utils::IsJunction(road.road_assigned_junction_id) ? map_api::LaneGroup::Type::kJunction
: map_api::LaneGroup::Type::kOneWay;
auto ref_left_lanes = utils::GetLanesRefs(left_lanes);
lane_group->lanes.insert(lane_group->lanes.end(),
std::make_move_iterator(ref_left_lanes.begin()),
std::make_move_iterator(ref_left_lanes.end()));
auto ref_center_boundaries_left = utils::GetLaneBoundariesRefs(center_boundaries_right);
lane_group->lane_boundaries.insert(lane_group->lane_boundaries.end(),
std::make_move_iterator(ref_center_boundaries_left.begin()),
std::make_move_iterator(ref_center_boundaries_left.end()));
auto ref_lane_boundaries = utils::GetLaneBoundariesRefs(lane_boundaries);
lane_group->lane_boundaries.insert(lane_group->lane_boundaries.end(),
std::make_move_iterator(ref_lane_boundaries.begin()),
std::make_move_iterator(ref_lane_boundaries.end()));
map_.lane_groups.push_back(std::move(lane_group));
}
}
}
Loading