From a92674022a23b98b688c7d738006d33abebe4749 Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Thu, 1 Jun 2017 11:43:53 +0200 Subject: [PATCH] make all u-turns continue --- features/car/conditional_restrictions.feature | 28 +++++++++---------- features/guidance/turn-lanes.feature | 4 +-- features/testbot/via.feature | 6 ++-- .../guidance/intersection_handler.cpp | 2 +- src/extractor/guidance/turn_analysis.cpp | 7 +++-- src/extractor/guidance/turn_lane_matcher.cpp | 4 +-- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/features/car/conditional_restrictions.feature b/features/car/conditional_restrictions.feature index fe316e54742..88f677a85ab 100644 --- a/features/car/conditional_restrictions.feature +++ b/features/car/conditional_restrictions.feature @@ -351,9 +351,9 @@ Feature: Car - Turn restrictions | restriction | ab | be | b | only_left_turn @ (Mo-Fr 07:00-11:00) | When I route I should get - | from | to | route | turns | - | a | c | albic,dobe,dobe,albic,albic | depart,turn left,turn uturn,turn left,arrive | - | a | e | albic,dobe,dobe | depart,turn left,arrive | + | from | to | route | turns | + | a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive | + | a | e | albic,dobe,dobe | depart,turn left,arrive | @shapelib @no_turning @conditionals Scenario: Car - only_right_turn @@ -611,10 +611,10 @@ Feature: Car - Turn restrictions | restriction | bg | bc | b | no_left_turn @ (Mo-Fr 07:00-09:30,16:00-18:30) | When I route I should get - | from | to | route | turns | - | a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,turn uturn,arrive | - | f | d | cap north,florida,florida nw | depart,turn left,arrive | - | e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive | + | from | to | route | turns | + | a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,continue uturn,arrive | + | f | d | cap north,florida,florida nw | depart,turn left,arrive | + | e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive | @shapelib @no_turning @conditionals Scenario: Car - DC North capitol situation, one on two off @@ -658,10 +658,10 @@ Feature: Car - Turn restrictions | restriction | bg | bc | b | no_left_turn @ (Mo-Fr 07:00-09:30,16:00-18:30) | When I route I should get - | from | to | route | turns | - | a | e | cap south,florida,florida ne | depart,turn left,arrive | - | f | d | cap north,florida ne,florida ne,florida nw | depart,turn sharp right,turn uturn,arrive | - | e | c | florida ne,cap south,cap south | depart,turn left,arrive | + | from | to | route | turns | + | a | e | cap south,florida,florida ne | depart,turn left,arrive | + | f | d | cap north,florida ne,florida ne,florida nw | depart,turn sharp right,continue uturn,arrive | + | e | c | florida ne,cap south,cap south | depart,turn left,arrive | @shapelib @only_turning @conditionals Scenario: Car - Somewhere in Liverpool, the UK, GMT timezone @@ -697,6 +697,6 @@ Feature: Car - Turn restrictions | restriction | ab | be | b | only_left_turn @ (Mo-Fr 07:00-11:00) | When I route I should get - | from | to | route | turns | - | a | c | albic,dobe,dobe,albic,albic | depart,turn left,turn uturn,turn left,arrive | - | a | e | albic,dobe,dobe | depart,turn left,arrive | + | from | to | route | turns | + | a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive | + | a | e | albic,dobe,dobe | depart,turn left,arrive | diff --git a/features/guidance/turn-lanes.feature b/features/guidance/turn-lanes.feature index db47334200b..c787c907650 100644 --- a/features/guidance/turn-lanes.feature +++ b/features/guidance/turn-lanes.feature @@ -134,7 +134,7 @@ Feature: Turn Lane Guidance | a | c | 180,180 180,180 | in,straight,straight | depart,new name straight,arrive | ,left;uturn:false straight;right:true, | a,b,c | | a | d | 180,180 180,180 | in,right,right | depart,turn right,arrive | ,left;uturn:false straight;right:true, | a,b,d | | a | e | 180,180 180,180 | in,left,left | depart,turn left,arrive | ,left;uturn:true straight;right:false, | a,b,e | - | 1 | a | 90,2 270,2 | in,in,in | depart,turn uturn,arrive | ,left;uturn:true straight;right:false, | _,b,a | + | 1 | a | 90,2 270,2 | in,in,in | depart,continue uturn,arrive | ,left;uturn:true straight;right:false, | _,b,a | #this next test requires decision on how to announce lanes for going straight if there is no turn @@ -629,7 +629,7 @@ Feature: Turn Lane Guidance When I route I should get | waypoints | route | turns | lanes | | a,f | road,left,left | depart,turn left,arrive | ,left:true left:true left:true straight:false straight:false, | - | a,e | road,road,road | depart,turn uturn,arrive | ,left:true left:false left:false straight:false straight:false, | + | a,e | road,road,road | depart,continue uturn,arrive | ,left:true left:false left:false straight:false straight:false, | | a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, | @todo @roundabout diff --git a/features/testbot/via.feature b/features/testbot/via.feature index 43da13a3914..89d0414078f 100644 --- a/features/testbot/via.feature +++ b/features/testbot/via.feature @@ -321,9 +321,9 @@ Feature: Via points | ab | When I route I should get - | waypoints | bearings | route | turns | - | 1,a | 90,2 270,2 | ab,ab,ab | depart,turn uturn,arrive | - | 1,b | 270,2 90,2 | ab,ab,ab | depart,turn uturn,arrive | + | waypoints | bearings | route | turns | + | 1,a | 90,2 270,2 | ab,ab,ab | depart,continue uturn,arrive | + | 1,b | 270,2 90,2 | ab,ab,ab | depart,continue uturn,arrive | Scenario: Continue Straight in presence of Bearings Given the node map diff --git a/src/extractor/guidance/intersection_handler.cpp b/src/extractor/guidance/intersection_handler.cpp index 57a8e872bb6..f345d14ae4b 100644 --- a/src/extractor/guidance/intersection_handler.cpp +++ b/src/extractor/guidance/intersection_handler.cpp @@ -85,7 +85,7 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t if (angularDeviation(road.angle, 0) < 0.01) { - return {TurnType::Turn, DirectionModifier::UTurn}; + return {TurnType::Continue, DirectionModifier::UTurn}; } if (type == TurnType::Turn) { diff --git a/src/extractor/guidance/turn_analysis.cpp b/src/extractor/guidance/turn_analysis.cpp index 5c1ab843fe0..937a40cf366 100644 --- a/src/extractor/guidance/turn_analysis.cpp +++ b/src/extractor/guidance/turn_analysis.cpp @@ -188,9 +188,10 @@ Intersection TurnAnalysis::setTurnTypes(const NodeID node_prior_to_intersection, const EdgeID onto_edge = road.eid; const NodeID to_nid = node_based_graph.GetTarget(onto_edge); - road.instruction = {TurnType::Turn, - (node_prior_to_intersection == to_nid) ? DirectionModifier::UTurn - : getTurnDirection(road.angle)}; + if (node_prior_to_intersection == to_nid) + road.instruction = {TurnType::Continue, DirectionModifier::UTurn}; + else + road.instruction = {TurnType::Turn, getTurnDirection(road.angle)}; } return intersection; } diff --git a/src/extractor/guidance/turn_lane_matcher.cpp b/src/extractor/guidance/turn_lane_matcher.cpp index d4ad568306d..fb2d41a4579 100644 --- a/src/extractor/guidance/turn_lane_matcher.cpp +++ b/src/extractor/guidance/turn_lane_matcher.cpp @@ -239,7 +239,7 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection, road_index = 2; } intersection[u_turn].entry_allowed = true; - intersection[u_turn].instruction.type = TurnType::Turn; + intersection[u_turn].instruction.type = TurnType::Continue; intersection[u_turn].instruction.direction_modifier = DirectionModifier::UTurn; matchRoad(intersection[u_turn], lane_data.back()); @@ -283,7 +283,7 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection, u_turn = intersection.size() - 1; } intersection[u_turn].entry_allowed = true; - intersection[u_turn].instruction.type = TurnType::Turn; + intersection[u_turn].instruction.type = TurnType::Continue; intersection[u_turn].instruction.direction_modifier = DirectionModifier::UTurn; matchRoad(intersection[u_turn], lane_data.back());