respect difference between continue/turn on changing end-of-road

This commit is contained in:
Moritz Kobitzsch 2017-08-11 16:35:39 +02:00
parent 196ed9eb46
commit 3687b6cb4b
5 changed files with 47 additions and 12 deletions

View File

@ -53,8 +53,8 @@ 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,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, | | a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false right:false right:true,left:false right:true, |
| e,a | MySt,MySt,MySt,MySt | depart,continue left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, | | e,a | MySt,MySt,MySt,MySt | depart,continue left,continue left,arrive | ,left:true left:false straight:false,left:true right:false, |
@anticipate @anticipate
Scenario: Anticipate Lane Change for quick same direction turns, changing between streets Scenario: Anticipate Lane Change for quick same direction turns, changing between streets
@ -781,7 +781,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,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, | | a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
@anticipate @anticipate
Scenario: Don't Overdo It Scenario: Don't Overdo It

View File

@ -629,8 +629,8 @@ Feature: Collapse
When I route I should get When I route I should get
| waypoints | turns | route | locations | | waypoints | turns | route | locations |
| a,d | depart,continue right,turn right,arrive | road,road,road,road | a,b,c,d | | a,d | depart,continue right,continue right,arrive | road,road,road,road | a,b,c,d |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | d,c,b,a | | d,a | depart,continue left,continue left,arrive | road,road,road,road | d,c,b,a |
Scenario: Forking before a turn Scenario: Forking before a turn
Given the node map Given the node map

View File

@ -136,3 +136,24 @@ Feature: Continue Instructions
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive | | a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
# continuing right here, since the turn to the left is more expensive # continuing right here, since the turn to the left is more expensive
| a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive | | a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
Scenario: End-Of-Road Continue
Given the node map
"""
a - b - c
|
d - e
|
f
"""
And the ways
| nodes | highway | name |
| abc | primary | road |
| bdf | primary | road |
| ed | primary | turn |
When I route I should get
| waypoints | route | turns |
| e,a | turn,road,road,road | depart,turn right,continue left,arrive |

View File

@ -836,8 +836,8 @@ Feature: Turn Lane Guidance
When I route I should get When I route I should get
| waypoints | turns | route | lanes | | waypoints | turns | route | lanes |
| a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, | | a,d | depart,continue right,continue right,arrive | road,road,road,road | ,straight:false right:true,, |
| d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, | | d,a | depart,continue left,continue left,arrive | road,road,road,road | ,left:true straight:false,, |
@simple @simple
Scenario: Merge Lanes Onto Freeway Scenario: Merge Lanes Onto Freeway

View File

@ -629,7 +629,21 @@ std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps)
BOOST_ASSERT(step_index > 0); BOOST_ASSERT(step_index > 0);
const auto &previous_step = steps[last_valid_instruction]; const auto &previous_step = steps[last_valid_instruction];
if (previous_step.intersections.size() < MIN_END_OF_ROAD_INTERSECTIONS) if (previous_step.intersections.size() < MIN_END_OF_ROAD_INTERSECTIONS)
step.maneuver.instruction.type = TurnType::Turn; {
bool same_name =
!(step.name.empty() && step.ref.empty()) &&
!util::guidance::requiresNameAnnounced(previous_step.name,
previous_step.ref,
previous_step.pronunciation,
previous_step.exits,
step.name,
step.ref,
step.pronunciation,
step.exits);
step.maneuver.instruction.type =
same_name ? TurnType::Continue : TurnType::Turn;
}
} }
// Remember the last non silent instruction // Remember the last non silent instruction