make all u-turns continue

This commit is contained in:
Moritz Kobitzsch 2017-06-01 11:43:53 +02:00 committed by Daniel J. H
parent ceaf065d0e
commit a92674022a
6 changed files with 26 additions and 25 deletions

View File

@ -351,9 +351,9 @@ Feature: Car - Turn restrictions
| restriction | ab | be | b | only_left_turn @ (Mo-Fr 07:00-11:00) | | restriction | ab | be | b | only_left_turn @ (Mo-Fr 07:00-11:00) |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,turn uturn,turn left,arrive | | a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
| a | e | albic,dobe,dobe | depart,turn left,arrive | | a | e | albic,dobe,dobe | depart,turn left,arrive |
@shapelib @no_turning @conditionals @shapelib @no_turning @conditionals
Scenario: Car - only_right_turn 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) | | restriction | bg | bc | b | no_left_turn @ (Mo-Fr 07:00-09:30,16:00-18:30) |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | e | cap south,florida nw,florida nw,florida ne | depart,turn right,turn uturn,arrive | | 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 | | 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 | | e | c | florida ne,florida nw,cap south,cap south | depart,continue uturn,turn right,arrive |
@shapelib @no_turning @conditionals @shapelib @no_turning @conditionals
Scenario: Car - DC North capitol situation, one on two off 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) | | restriction | bg | bc | b | no_left_turn @ (Mo-Fr 07:00-09:30,16:00-18:30) |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | e | cap south,florida,florida ne | depart,turn left,arrive | | 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 | | 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 | | e | c | florida ne,cap south,cap south | depart,turn left,arrive |
@shapelib @only_turning @conditionals @shapelib @only_turning @conditionals
Scenario: Car - Somewhere in Liverpool, the UK, GMT timezone 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) | | restriction | ab | be | b | only_left_turn @ (Mo-Fr 07:00-11:00) |
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | c | albic,dobe,dobe,albic,albic | depart,turn left,turn uturn,turn left,arrive | | a | c | albic,dobe,dobe,albic,albic | depart,turn left,continue uturn,turn left,arrive |
| a | e | albic,dobe,dobe | depart,turn left,arrive | | a | e | albic,dobe,dobe | depart,turn left,arrive |

View File

@ -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 | 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 | 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 | | 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 #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 When I route I should get
| waypoints | route | turns | lanes | | waypoints | route | turns | lanes |
| a,f | road,left,left | depart,turn left,arrive | ,left:true left:true left:true straight:false straight:false, | | 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, | | a,g | road,straight,straight | depart,new name straight,arrive | ,left:false left:false left:false straight:true straight:true, |
@todo @roundabout @todo @roundabout

View File

@ -321,9 +321,9 @@ Feature: Via points
| ab | | ab |
When I route I should get When I route I should get
| waypoints | bearings | route | turns | | waypoints | bearings | route | turns |
| 1,a | 90,2 270,2 | ab,ab,ab | depart,turn uturn,arrive | | 1,a | 90,2 270,2 | ab,ab,ab | depart,continue uturn,arrive |
| 1,b | 270,2 90,2 | ab,ab,ab | depart,turn uturn,arrive | | 1,b | 270,2 90,2 | ab,ab,ab | depart,continue uturn,arrive |
Scenario: Continue Straight in presence of Bearings Scenario: Continue Straight in presence of Bearings
Given the node map Given the node map

View File

@ -85,7 +85,7 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
if (angularDeviation(road.angle, 0) < 0.01) if (angularDeviation(road.angle, 0) < 0.01)
{ {
return {TurnType::Turn, DirectionModifier::UTurn}; return {TurnType::Continue, DirectionModifier::UTurn};
} }
if (type == TurnType::Turn) if (type == TurnType::Turn)
{ {

View File

@ -188,9 +188,10 @@ Intersection TurnAnalysis::setTurnTypes(const NodeID node_prior_to_intersection,
const EdgeID onto_edge = road.eid; const EdgeID onto_edge = road.eid;
const NodeID to_nid = node_based_graph.GetTarget(onto_edge); const NodeID to_nid = node_based_graph.GetTarget(onto_edge);
road.instruction = {TurnType::Turn, if (node_prior_to_intersection == to_nid)
(node_prior_to_intersection == to_nid) ? DirectionModifier::UTurn road.instruction = {TurnType::Continue, DirectionModifier::UTurn};
: getTurnDirection(road.angle)}; else
road.instruction = {TurnType::Turn, getTurnDirection(road.angle)};
} }
return intersection; return intersection;
} }

View File

@ -239,7 +239,7 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
road_index = 2; road_index = 2;
} }
intersection[u_turn].entry_allowed = true; 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; intersection[u_turn].instruction.direction_modifier = DirectionModifier::UTurn;
matchRoad(intersection[u_turn], lane_data.back()); matchRoad(intersection[u_turn], lane_data.back());
@ -283,7 +283,7 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
u_turn = intersection.size() - 1; u_turn = intersection.size() - 1;
} }
intersection[u_turn].entry_allowed = true; 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; intersection[u_turn].instruction.direction_modifier = DirectionModifier::UTurn;
matchRoad(intersection[u_turn], lane_data.back()); matchRoad(intersection[u_turn], lane_data.back());