From a17b07bc4ccd47b3b102c7863b3b1c8caf3c71c2 Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Mon, 7 Aug 2017 14:10:06 +0200 Subject: [PATCH] fix bug in conflict resolution --- features/guidance/dedicated-turn-roads.feature | 4 ++-- features/guidance/turn.feature | 6 +++--- src/extractor/guidance/turn_handler.cpp | 14 ++++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/features/guidance/dedicated-turn-roads.feature b/features/guidance/dedicated-turn-roads.feature index deaa59b81df..4e57ee8a512 100644 --- a/features/guidance/dedicated-turn-roads.feature +++ b/features/guidance/dedicated-turn-roads.feature @@ -863,8 +863,8 @@ Feature: Slipways and Dedicated Turn Lanes | af | primary | sliproad | yes | When I route I should get - | waypoints | route | turns | locations | - | s,g | main,sliproad,another,another | depart,turn right,turn left,arrive | s,a,f,g | + | waypoints | route | turns | locations | + | s,g | main,sliproad,another,another | depart,turn right,turn slight left,arrive | s,a,f,g | @sliproads: Scenario: Throughabout-Sliproad diff --git a/features/guidance/turn.feature b/features/guidance/turn.feature index 332bae7ad3c..fecaf0ea03f 100644 --- a/features/guidance/turn.feature +++ b/features/guidance/turn.feature @@ -788,9 +788,9 @@ Feature: Simple Turns | bg | primary | yes | When I route I should get - | waypoints | route | turns | - | a,d | abc,bd,bd | depart,turn sharp right,arrive | - | a,f | abc,bf,bf | depart,turn right,arrive | + | waypoints | route | turns | + | a,d | abc,bd,bd | depart,turn right,arrive | + | a,f | abc,bf,bf | depart,turn slight right,arrive | Scenario: Right Turn Assignment Three Conflicting Turns with invalid - 3 Given the node map diff --git a/src/extractor/guidance/turn_handler.cpp b/src/extractor/guidance/turn_handler.cpp index aff5699f774..72202da3d7b 100644 --- a/src/extractor/guidance/turn_handler.cpp +++ b/src/extractor/guidance/turn_handler.cpp @@ -391,6 +391,7 @@ Intersection TurnHandler::handleComplexTurn(const EdgeID via_edge, Intersection { assignTrivialTurns(via_edge, intersection, 1, intersection.size()); } + return intersection; } @@ -744,7 +745,7 @@ void TurnHandler::handleDistinctConflict(const EdgeID via_edge, right.instruction = {right_type, DirectionModifier::Right}; return; } - // Two Right Turns + // Two Left Turns if (angularDeviation(left.angle, 270) < MAXIMAL_ALLOWED_NO_TURN_DEVIATION) { // Keep left perfect, shift right @@ -773,17 +774,18 @@ void TurnHandler::handleDistinctConflict(const EdgeID via_edge, return; } - if (getTurnDirection(left.angle) == DirectionModifier::Right) + // turn to the right + if (getTurnDirection(left.angle) <= 180) { if (angularDeviation(left.angle, 85) >= angularDeviation(right.angle, 85)) { - left.instruction = {left_type, DirectionModifier::Right}; - right.instruction = {right_type, DirectionModifier::SharpRight}; + left.instruction = {left_type, DirectionModifier::SlightRight}; + right.instruction = {right_type, DirectionModifier::Right}; } else { - left.instruction = {left_type, DirectionModifier::SlightRight}; - right.instruction = {right_type, DirectionModifier::Right}; + left.instruction = {left_type, DirectionModifier::Right}; + right.instruction = {right_type, DirectionModifier::SharpRight}; } } else