Formating and logging changes for turn classification
This commit is contained in:
parent
10097a946f
commit
ea93d56ca8
@ -295,10 +295,9 @@ TurnAnalysis::fallbackTurnAssignmentMotorway(std::vector<TurnCandidate> turn_can
|
|||||||
candidate.instruction = {type, DirectionModifier::Straight};
|
candidate.instruction = {type, DirectionModifier::Straight};
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
candidate.instruction = {type,
|
candidate.instruction = {type, candidate.angle > STRAIGHT_ANGLE
|
||||||
candidate.angle > STRAIGHT_ANGLE
|
? DirectionModifier::SlightLeft
|
||||||
? DirectionModifier::SlightLeft
|
: DirectionModifier::SlightRight};
|
||||||
: DirectionModifier::SlightRight};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return turn_candidates;
|
return turn_candidates;
|
||||||
@ -336,8 +335,8 @@ std::vector<TurnCandidate> TurnAnalysis::handleFromMotorway(
|
|||||||
return turn_candidates[0].angle;
|
return turn_candidates[0].angle;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto getMostLikelyContinue =
|
const auto getMostLikelyContinue = [this,
|
||||||
[this, in_data](const std::vector<TurnCandidate> &turn_candidates)
|
in_data](const std::vector<TurnCandidate> &turn_candidates)
|
||||||
{
|
{
|
||||||
double angle = turn_candidates[0].angle;
|
double angle = turn_candidates[0].angle;
|
||||||
double best = 180;
|
double best = 180;
|
||||||
@ -539,8 +538,9 @@ std::vector<TurnCandidate> TurnAnalysis::handleFromMotorway(
|
|||||||
auto coord = localizer(node_based_graph.GetTarget(via_edge));
|
auto coord = localizer(node_based_graph.GetTarget(via_edge));
|
||||||
util::SimpleLogger().Write(logWARNING)
|
util::SimpleLogger().Write(logWARNING)
|
||||||
<< "Found motorway junction with more than "
|
<< "Found motorway junction with more than "
|
||||||
"2 exiting motorways or additional ramps at " << std::setprecision(12)
|
"2 exiting motorways or additional ramps at "
|
||||||
<< toFloating(coord.lat) << " " << toFloating(coord.lon);
|
<< std::setprecision(12) << toFloating(coord.lat) << " "
|
||||||
|
<< toFloating(coord.lon);
|
||||||
fallbackTurnAssignmentMotorway(turn_candidates);
|
fallbackTurnAssignmentMotorway(turn_candidates);
|
||||||
}
|
}
|
||||||
} // done for more than one highway exit
|
} // done for more than one highway exit
|
||||||
@ -676,8 +676,8 @@ std::vector<TurnCandidate> TurnAnalysis::handleMotorwayRamp(
|
|||||||
}
|
}
|
||||||
else if (detail::isMotorwayClass(edge_data.road_classification.road_class))
|
else if (detail::isMotorwayClass(edge_data.road_classification.road_class))
|
||||||
{
|
{
|
||||||
candidate.instruction = {TurnType::Merge,
|
candidate.instruction = {TurnType::Merge, passed_highway_entry
|
||||||
passed_highway_entry ? DirectionModifier::SlightRight
|
? DirectionModifier::SlightRight
|
||||||
: DirectionModifier::SlightLeft};
|
: DirectionModifier::SlightLeft};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -972,8 +972,8 @@ std::vector<TurnCandidate> TurnAnalysis::handleThreeWayTurn(
|
|||||||
node_based_graph.GetEdgeData(turn_candidates[1].eid).name_id ==
|
node_based_graph.GetEdgeData(turn_candidates[1].eid).name_id ==
|
||||||
node_based_graph.GetEdgeData(turn_candidates[2].eid).name_id)
|
node_based_graph.GetEdgeData(turn_candidates[2].eid).name_id)
|
||||||
{
|
{
|
||||||
const auto findTurn = [isObviousOfTwo](const TurnCandidate turn, const TurnCandidate other)
|
const auto findTurn = [isObviousOfTwo](const TurnCandidate turn,
|
||||||
-> TurnInstruction
|
const TurnCandidate other) -> TurnInstruction
|
||||||
{
|
{
|
||||||
return {isObviousOfTwo(turn, other) ? TurnType::Merge : TurnType::Turn,
|
return {isObviousOfTwo(turn, other) ? TurnType::Merge : TurnType::Turn,
|
||||||
getTurnDirection(turn.angle)};
|
getTurnDirection(turn.angle)};
|
||||||
@ -1133,13 +1133,13 @@ std::vector<TurnCandidate> TurnAnalysis::handleFourWayTurn(
|
|||||||
if (fallback_count++ < 10)
|
if (fallback_count++ < 10)
|
||||||
{
|
{
|
||||||
const auto coord = localizer(node_based_graph.GetTarget(via_edge));
|
const auto coord = localizer(node_based_graph.GetTarget(via_edge));
|
||||||
util::SimpleLogger().Write(logWARNING)
|
util::SimpleLogger().Write(logDEBUG)
|
||||||
<< "Resolved to keep fallback on four way turn assignment at "
|
<< "Resolved to keep fallback on four way turn assignment at "
|
||||||
<< std::setprecision(12) << toFloating(coord.lat) << " " << toFloating(coord.lon);
|
<< std::setprecision(12) << toFloating(coord.lat) << " " << toFloating(coord.lon);
|
||||||
for (const auto &candidate : turn_candidates)
|
for (const auto &candidate : turn_candidates)
|
||||||
{
|
{
|
||||||
const auto &out_data = node_based_graph.GetEdgeData(candidate.eid);
|
const auto &out_data = node_based_graph.GetEdgeData(candidate.eid);
|
||||||
util::SimpleLogger().Write(logWARNING)
|
util::SimpleLogger().Write(logDEBUG)
|
||||||
<< "Candidate: " << candidate.toString() << " Name: " << out_data.name_id
|
<< "Candidate: " << candidate.toString() << " Name: " << out_data.name_id
|
||||||
<< " Road Class: " << (int)out_data.road_classification.road_class
|
<< " Road Class: " << (int)out_data.road_classification.road_class
|
||||||
<< " At: " << localizer(node_based_graph.GetTarget(candidate.eid));
|
<< " At: " << localizer(node_based_graph.GetTarget(candidate.eid));
|
||||||
@ -1288,7 +1288,7 @@ TurnAnalysis::optimizeCandidates(const EdgeID via_eid,
|
|||||||
if (turn.angle == left.angle)
|
if (turn.angle == left.angle)
|
||||||
{
|
{
|
||||||
util::SimpleLogger().Write(logWARNING)
|
util::SimpleLogger().Write(logWARNING)
|
||||||
<< "[warning] conflicting turn angles, identical road duplicated? "
|
<< "conflicting turn angles, identical road duplicated? "
|
||||||
<< std::setprecision(12) << node_info_list[node_based_graph.GetTarget(via_eid)].lat
|
<< std::setprecision(12) << node_info_list[node_based_graph.GetTarget(via_eid)].lat
|
||||||
<< " " << node_info_list[node_based_graph.GetTarget(via_eid)].lon << std::endl;
|
<< " " << node_info_list[node_based_graph.GetTarget(via_eid)].lon << std::endl;
|
||||||
}
|
}
|
||||||
@ -1457,8 +1457,8 @@ bool TurnAnalysis::isObviousChoice(const EdgeID via_eid,
|
|||||||
|
|
||||||
const auto &candidate_to_the_right = turn_candidates[getRight(turn_index)];
|
const auto &candidate_to_the_right = turn_candidates[getRight(turn_index)];
|
||||||
|
|
||||||
const auto hasValidRatio =
|
const auto hasValidRatio = [&](const TurnCandidate &left, const TurnCandidate ¢er,
|
||||||
[&](const TurnCandidate &left, const TurnCandidate ¢er, const TurnCandidate &right)
|
const TurnCandidate &right)
|
||||||
{
|
{
|
||||||
auto angle_left = (left.angle > 180) ? angularDeviation(left.angle, STRAIGHT_ANGLE) : 180;
|
auto angle_left = (left.angle > 180) ? angularDeviation(left.angle, STRAIGHT_ANGLE) : 180;
|
||||||
auto angle_right =
|
auto angle_right =
|
||||||
@ -1778,8 +1778,9 @@ std::vector<TurnCandidate> TurnAnalysis::mergeSegregatedRoads(
|
|||||||
std::cout << "Second: " << second_data.name_id << " " << second_data.travel_mode << " "
|
std::cout << "Second: " << second_data.name_id << " " << second_data.travel_mode << " "
|
||||||
<< second_data.road_classification.road_class << " "
|
<< second_data.road_classification.road_class << " "
|
||||||
<< turn_candidates[second].angle << " " << second_data.reversed << std::endl;
|
<< turn_candidates[second].angle << " " << second_data.reversed << std::endl;
|
||||||
std::cout << "Deviation: " << angularDeviation(turn_candidates[first].angle,
|
std::cout << "Deviation: "
|
||||||
turn_candidates[second].angle) << std::endl;
|
<< angularDeviation(turn_candidates[first].angle, turn_candidates[second].angle)
|
||||||
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return first_data.name_id != INVALID_NAME_ID && first_data.name_id == second_data.name_id &&
|
return first_data.name_id != INVALID_NAME_ID && first_data.name_id == second_data.name_id &&
|
||||||
|
Loading…
Reference in New Issue
Block a user