Old GetLaneWidth now using new parsed lane width

This commit is contained in:
Marc Garcia Puig 2019-03-01 01:04:14 +01:00
parent 6966d56c76
commit c012b48e73
1 changed files with 8 additions and 3 deletions

View File

@ -172,9 +172,14 @@ namespace element {
} }
double Waypoint::GetLaneWidth() const { double Waypoint::GetLaneWidth() const {
const auto info = GetRoadSegment().GetInfo<RoadInfoLane>(_dist); const auto *road_segment = _map->GetData().GetRoad(_road_id);
const auto lane_info = info != nullptr ? info->getLane(_lane_id) : nullptr; const auto lane_width_info = road_segment->GetInfos<RoadInfoLaneWidth>(_dist);
return lane_info != nullptr ? lane_info->_width : 0.0; for (auto &&lane : lane_width_info) {
if (lane->GetLaneId() == _lane_id) {
return lane->GetPolynomial().Evaluate(_dist);
}
}
return 0.0;
} }
std::pair<RoadInfoMarkRecord, RoadInfoMarkRecord> Waypoint::GetMarkRecord() const { std::pair<RoadInfoMarkRecord, RoadInfoMarkRecord> Waypoint::GetMarkRecord() const {