Skip to content

Commit 3687b6c

Browse files
author
Moritz Kobitzsch
committed
respect difference between continue/turn on changing end-of-road
1 parent 196ed9e commit 3687b6c

File tree

5 files changed

+47
-12
lines changed

5 files changed

+47
-12
lines changed

features/guidance/anticipate-lanes.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Feature: Turn Lane Guidance
5252
| dy | | | YSt |
5353

5454
When I route I should get
55-
| waypoints | route | turns | lanes |
56-
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false right:false right:true,left:false right:true, |
57-
| e,a | MySt,MySt,MySt,MySt | depart,continue left,turn left,arrive | ,left:true left:false straight:false,left:true right:false, |
55+
| waypoints | route | turns | lanes |
56+
| a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false right:false right:true,left:false right:true, |
57+
| e,a | MySt,MySt,MySt,MySt | depart,continue left,continue left,arrive | ,left:true left:false straight:false,left:true right:false, |
5858

5959
@anticipate
6060
Scenario: Anticipate Lane Change for quick same direction turns, changing between streets
@@ -780,8 +780,8 @@ Feature: Turn Lane Guidance
780780
| dy | | YSt |
781781

782782
When I route I should get
783-
| waypoints | route | turns | lanes |
784-
| a,e | MySt,MySt,MySt,MySt | depart,continue right,turn right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
783+
| waypoints | route | turns | lanes |
784+
| a,e | MySt,MySt,MySt,MySt | depart,continue right,continue right,arrive | ,straight:false straight:false right:false right:true,left:false right:true, |
785785

786786
@anticipate
787787
Scenario: Don't Overdo It

features/guidance/collapse.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,9 @@ Feature: Collapse
628628
| cf | secondary | bottom |
629629

630630
When I route I should get
631-
| waypoints | turns | route | locations |
632-
| a,d | depart,continue right,turn right,arrive | road,road,road,road | a,b,c,d |
633-
| d,a | depart,continue left,turn left,arrive | road,road,road,road | d,c,b,a |
631+
| waypoints | turns | route | locations |
632+
| a,d | depart,continue right,continue right,arrive | road,road,road,road | a,b,c,d |
633+
| d,a | depart,continue left,continue left,arrive | road,road,road,road | d,c,b,a |
634634

635635
Scenario: Forking before a turn
636636
Given the node map

features/guidance/continue.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,24 @@ Feature: Continue Instructions
136136
| a,d | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
137137
# continuing right here, since the turn to the left is more expensive
138138
| a,e | abcdefb,abcdefb,abcdefb | depart,continue right,arrive |
139+
140+
Scenario: End-Of-Road Continue
141+
Given the node map
142+
"""
143+
a - b - c
144+
|
145+
d - e
146+
|
147+
f
148+
"""
149+
150+
And the ways
151+
| nodes | highway | name |
152+
| abc | primary | road |
153+
| bdf | primary | road |
154+
| ed | primary | turn |
155+
156+
157+
When I route I should get
158+
| waypoints | route | turns |
159+
| e,a | turn,road,road,road | depart,turn right,continue left,arrive |

features/guidance/turn-lanes.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,9 @@ Feature: Turn Lane Guidance
835835
| cf | secondary | bottom | |
836836

837837
When I route I should get
838-
| waypoints | turns | route | lanes |
839-
| a,d | depart,continue right,turn right,arrive | road,road,road,road | ,straight:false right:true,, |
840-
| d,a | depart,continue left,turn left,arrive | road,road,road,road | ,left:true straight:false,, |
838+
| waypoints | turns | route | lanes |
839+
| a,d | depart,continue right,continue right,arrive | road,road,road,road | ,straight:false right:true,, |
840+
| d,a | depart,continue left,continue left,arrive | road,road,road,road | ,left:true straight:false,, |
841841

842842
@simple
843843
Scenario: Merge Lanes Onto Freeway

src/engine/guidance/post_processing.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,21 @@ std::vector<RouteStep> buildIntersections(std::vector<RouteStep> steps)
629629
BOOST_ASSERT(step_index > 0);
630630
const auto &previous_step = steps[last_valid_instruction];
631631
if (previous_step.intersections.size() < MIN_END_OF_ROAD_INTERSECTIONS)
632-
step.maneuver.instruction.type = TurnType::Turn;
632+
{
633+
bool same_name =
634+
!(step.name.empty() && step.ref.empty()) &&
635+
!util::guidance::requiresNameAnnounced(previous_step.name,
636+
previous_step.ref,
637+
previous_step.pronunciation,
638+
previous_step.exits,
639+
step.name,
640+
step.ref,
641+
step.pronunciation,
642+
step.exits);
643+
644+
step.maneuver.instruction.type =
645+
same_name ? TurnType::Continue : TurnType::Turn;
646+
}
633647
}
634648

635649
// Remember the last non silent instruction

0 commit comments

Comments
 (0)