From 8831ca2f322a490c329c176af411e6fd96d39f64 Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Mon, 18 Jul 2016 15:36:32 +0200 Subject: [PATCH] fix roundabouts with traffic lights --- features/guidance/roundabout.feature | 39 +++++++++++++++++++++++++ src/engine/guidance/post_processing.cpp | 7 +++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index 9b622f658..fe6605be3 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -437,3 +437,42 @@ Feature: Basic Roundabout When I route I should get | waypoints | route | turns | | a,k | massachusetts,massachusetts,massachusetts,massachusetts | depart,sheridan circle-exit-2,dupont circle-exit-1,arrive | + + Scenario: Enter and Exit - Traffic Signals + Given the node map + | | | a | | | + | | i | b | l | | + | h | g | | c | d | + | | j | e | k | | + | | | f | | | + + And the nodes + | node | highway | + | i | traffic_signals | + | j | traffic_signals | + | k | traffic_signals | + | l | traffic_signals | + + And the ways + | nodes | junction | + | ab | | + | cd | | + | ef | | + | gh | | + | bigjekclb | roundabout | + + When I route I should get + | waypoints | route | turns | + | a,d | ab,cd,cd | depart,roundabout-exit-3,arrive | + | a,f | ab,ef,ef | depart,roundabout-exit-2,arrive | + | a,h | ab,gh,gh | depart,roundabout-exit-1,arrive | + | d,f | cd,ef,ef | depart,roundabout-exit-3,arrive | + | d,h | cd,gh,gh | depart,roundabout-exit-2,arrive | + | d,a | cd,ab,ab | depart,roundabout-exit-1,arrive | + | f,h | ef,gh,gh | depart,roundabout-exit-3,arrive | + | f,a | ef,ab,ab | depart,roundabout-exit-2,arrive | + | f,d | ef,cd,cd | depart,roundabout-exit-1,arrive | + | h,a | gh,ab,ab | depart,roundabout-exit-3,arrive | + | h,d | gh,cd,cd | depart,roundabout-exit-2,arrive | + | h,f | gh,ef,ef | depart,roundabout-exit-1,arrive | + diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp index f22599a5c..6f4b0cab5 100644 --- a/src/engine/guidance/post_processing.cpp +++ b/src/engine/guidance/post_processing.cpp @@ -1,5 +1,5 @@ -#include "engine/guidance/post_processing.hpp" #include "extractor/guidance/turn_instruction.hpp" +#include "engine/guidance/post_processing.hpp" #include "engine/guidance/assemble_steps.hpp" #include "engine/guidance/lane_processing.hpp" @@ -535,7 +535,6 @@ std::vector anticipateLaneChangeForRoundabouts(std::vector }; forEachRoundabout(begin(steps), end(steps), anticipate_lanes_in_roundabout); - return steps; } } // namespace @@ -628,6 +627,10 @@ std::vector postProcess(std::vector steps) has_entered_roundabout = false; on_roundabout = false; } + else if (on_roundabout && step_index + 1 < steps.size()) + { + steps[step_index + 1].maneuver.exit = step.maneuver.exit; + } } // unterminated roundabout