From d9fcf1ecf7408dabf438dd025b512fba258dfded Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 22 Dec 2017 23:39:49 +0000 Subject: [PATCH] Make sure we only count turns as UTurns for the turn_function --- CHANGELOG.md | 5 +++++ include/extractor/guidance/turn_instruction.hpp | 6 +++++- src/extractor/edge_based_graph_factory.cpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 839de4e4e..d70f47cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 5.14.3 + - Changes from 5.14.2: + - Bugfixes: + - FIXED #4754: U-Turn penalties are applied to straight turns. + # 5.14.2 - Changes from 5.14.1: - Bugfixes: diff --git a/include/extractor/guidance/turn_instruction.hpp b/include/extractor/guidance/turn_instruction.hpp index 09eb28d7a..591899231 100644 --- a/include/extractor/guidance/turn_instruction.hpp +++ b/include/extractor/guidance/turn_instruction.hpp @@ -77,7 +77,11 @@ struct TurnInstruction TurnType::Enum type : 5; DirectionModifier::Enum direction_modifier : 3; - // the lane tupel that is used for the turn + + bool IsUTurn() const + { + return type == TurnType::Turn && direction_modifier == DirectionModifier::UTurn; + } static TurnInstruction INVALID() { return {TurnType::Invalid, DirectionModifier::UTurn}; } diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index 398f3bac2..ac038be4b 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -580,7 +580,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( ExtractionTurn extracted_turn( turn.angle, m_node_based_graph.GetOutDegree(node_at_center_of_intersection), - turn.instruction.direction_modifier == guidance::DirectionModifier::UTurn, + turn.instruction.IsUTurn(), is_traffic_light, edge_data1.flags.restricted, edge_data2.flags.restricted,