From 6dd029e6ea8ab47d3ebcb0576410fc7158d6092a Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Sat, 23 Dec 2017 14:08:55 +0000 Subject: [PATCH] Restore original intend of roundabout test When doing the new Lua version refactor we changed the expectation to use `continue uturn` instead of making a whole circle in the roundabout as the original test case. This was only the shortest path since there was no roundabout penalty. --- features/guidance/roundabout.feature | 23 +++++++++++-------- .../extractor/guidance/turn_instruction.hpp | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index 062a683c8..3b5610dcd 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -745,12 +745,15 @@ Feature: Basic Roundabout Scenario: Drive through roundabout + Given a grid size of 5 meters Given the node map """ - a - b e d f - c - g h + . a . + . . + b e --- d ---- f + . . + .c. + g h """ And the ways @@ -760,12 +763,12 @@ Feature: Basic Roundabout | gch | | yes | When I route I should get - | waypoints | bearings | route | turns | - | e,f | 90 90 | edf,edf | depart,arrive | - | e,h | 90 135 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive | - | g,f | 45 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout right,arrive | - | g,h | 45 135 | gch,gch,gch | depart,exit roundabout right,arrive | - | e,e | 90 270 | edf,edf,edf | depart,continue uturn,arrive | + | waypoints | bearings | route | turns | + | e,f | 90 90 | edf,edf | depart,arrive | + | e,h | 90 130 | edf,gch,gch,gch | depart,roundabout-exit-2,exit roundabout straight,arrive | + | g,f | 50 90 | gch,edf,edf,edf | depart,roundabout-exit-2,exit roundabout slight right,arrive | + | g,h | 50 130 | gch,gch,gch | depart,exit roundabout right,arrive | + | e,e | 90 270 | edf,edf,edf,edf | depart,roundabout-exit-3,exit roundabout sharp left,arrive | Scenario: CCW and CW roundabouts with overlaps Given the node map diff --git a/include/extractor/guidance/turn_instruction.hpp b/include/extractor/guidance/turn_instruction.hpp index 591899231..3647c8092 100644 --- a/include/extractor/guidance/turn_instruction.hpp +++ b/include/extractor/guidance/turn_instruction.hpp @@ -80,7 +80,7 @@ struct TurnInstruction bool IsUTurn() const { - return type == TurnType::Turn && direction_modifier == DirectionModifier::UTurn; + return type != TurnType::NoTurn && direction_modifier == DirectionModifier::UTurn; } static TurnInstruction INVALID() { return {TurnType::Invalid, DirectionModifier::UTurn}; }