Skip to content

Commit

Permalink
make all u-turns continue
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Kobitzsch authored and daniel-j-h committed Jun 1, 2017
1 parent ceaf065 commit a926740
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
28 changes: 14 additions & 14 deletions features/car/conditional_restrictions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 |
4 changes: 2 additions & 2 deletions features/guidance/turn-lanes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions features/testbot/via.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/extractor/guidance/intersection_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
7 changes: 4 additions & 3 deletions src/extractor/guidance/turn_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/extractor/guidance/turn_lane_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit a926740

Please sign in to comment.