Review fix.
This commit is contained in:
parent
bb8e3af4e4
commit
c4bf8d3f58
|
@ -750,9 +750,10 @@ namespace road {
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
// Checks whether the geometry is straight or not
|
// Checks whether the geometry is straight or not
|
||||||
bool IsLineStraight(const Road &road,
|
bool IsLaneStraight(const Lane &lane) {
|
||||||
const Lane &lane,
|
Road *road = lane.GetRoad();
|
||||||
const element::RoadInfoGeometry* geometry) {
|
auto *geometry = road->GetInfo<RoadInfoGeometry>(lane.GetDistance());
|
||||||
|
DEBUG_ASSERT(geometry != nullptr);
|
||||||
auto geometry_type = geometry->GetGeometry().GetType();
|
auto geometry_type = geometry->GetGeometry().GetType();
|
||||||
if (geometry_type != element::GeometryType::LINE) {
|
if (geometry_type != element::GeometryType::LINE) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -769,7 +770,7 @@ namespace road {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto elevations = road.GetInfos<element::RoadInfoElevation>();
|
auto elevations = road->GetInfos<element::RoadInfoElevation>();
|
||||||
for (auto *elevation : elevations) {
|
for (auto *elevation : elevations) {
|
||||||
if (abs(elevation->GetPolynomial().GetC()) > 0 ||
|
if (abs(elevation->GetPolynomial().GetC()) > 0 ||
|
||||||
abs(elevation->GetPolynomial().GetD()) > 0) {
|
abs(elevation->GetPolynomial().GetD()) > 0) {
|
||||||
|
@ -852,14 +853,12 @@ namespace road {
|
||||||
|
|
||||||
auto current_waypoint = lane_start_waypoint;
|
auto current_waypoint = lane_start_waypoint;
|
||||||
|
|
||||||
const Road &road = _data.GetRoad(current_waypoint.road_id);
|
|
||||||
const Lane &lane = GetLane(current_waypoint);
|
const Lane &lane = GetLane(current_waypoint);
|
||||||
const auto *geometry = road.GetInfo<element::RoadInfoGeometry>(current_waypoint.s);
|
|
||||||
|
|
||||||
geom::Transform current_transform = ComputeTransform(current_waypoint);
|
geom::Transform current_transform = ComputeTransform(current_waypoint);
|
||||||
|
|
||||||
// Save computation time in straight lines
|
// Save computation time in straight lines
|
||||||
if (IsLineStraight(road, lane, geometry)) {
|
if (IsLaneStraight(lane)) {
|
||||||
double delta_s = min_delta_s;
|
double delta_s = min_delta_s;
|
||||||
double remaining_length =
|
double remaining_length =
|
||||||
GetRemainingLength(lane, current_waypoint.s);
|
GetRemainingLength(lane, current_waypoint.s);
|
||||||
|
|
Loading…
Reference in New Issue