fix getTurnDirection, widen straight
range, adjust tests accordingly
This commit is contained in:
parent
fa1a0a1325
commit
78583d2c8c
@ -724,11 +724,11 @@ Feature: Collapse
|
|||||||
| restriction | bc | dc | c | no_right_turn |
|
| restriction | bc | dc | c | no_right_turn |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,g | road,cross,cross | depart,turn left,arrive |
|
| a,g | road,cross,cross | depart,turn left,arrive |
|
||||||
| a,e | road,road,road | depart,continue slight right,arrive |
|
| a,e | road,road,road | depart,continue straight,arrive |
|
||||||
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
# We should discuss whether the next item should be collapsed to depart,turn right,arrive.
|
||||||
| a,f | road,road,cross,cross | depart,continue slight right,turn right,arrive |
|
| a,f | road,road,cross,cross | depart,continue straight,turn right,arrive |
|
||||||
|
|
||||||
Scenario: On-Off on Highway
|
Scenario: On-Off on Highway
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -755,12 +755,13 @@ Feature: Collapse
|
|||||||
Scenario: Don't collapse going straight if actual turn
|
Scenario: Don't collapse going straight if actual turn
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
c e
|
e
|
||||||
d f
|
c |
|
||||||
|
\ d - - - f
|
||||||
|
\|
|
||||||
b
|
b
|
||||||
|
|
|
||||||
|
|
|
||||||
a
|
a
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -771,10 +772,10 @@ Feature: Collapse
|
|||||||
| df | right | residential |
|
| df | right | residential |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns | locations |
|
||||||
| a,c | main,main | depart,arrive |
|
| a,c | main,main | depart,arrive | a,c |
|
||||||
| a,e | main,straight,straight | depart,turn straight,arrive |
|
| a,e | main,straight,straight | depart,turn straight,arrive | a,b,e |
|
||||||
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive |
|
| a,f | main,straight,right,right | depart,turn straight,turn right,arrive | a,b,d,f |
|
||||||
|
|
||||||
Scenario: Entering a segregated road
|
Scenario: Entering a segregated road
|
||||||
Given the node map
|
Given the node map
|
||||||
|
@ -773,7 +773,7 @@ Feature: Simple Turns
|
|||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,j | Siemens,Siemens,Siemens | depart,continue slight right,arrive |
|
| a,j | Siemens,Siemens,Siemens | depart,continue straight,arrive |
|
||||||
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
| a,g | Siemens,Erna,Erna | depart,new name slight left,arrive |
|
||||||
| g,j | Erna,Siemens,Siemens | depart,turn sharp left,arrive |
|
| g,j | Erna,Siemens,Siemens | depart,turn sharp left,arrive |
|
||||||
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
| g,a | Erna,Siemens,Siemens | depart,new name slight right,arrive |
|
||||||
|
@ -1373,5 +1373,5 @@ Feature: Simple Turns
|
|||||||
| kchm | Alexanderstr | primary | yes |
|
| kchm | Alexanderstr | primary | yes |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | turns | route |
|
| waypoints | turns | route |
|
||||||
| a,d | depart,new name straight,arrive | Stralauer Str,Holzmarktstr,Holzmarktstr |
|
| a,d | depart,arrive | Stralauer Str,Holzmarktstr |
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
/* A set of tools required for guidance in both pre and post-processing */
|
/* A set of tools required for guidance in both pre and post-processing */
|
||||||
|
|
||||||
|
#include "extractor/guidance/constants.hpp"
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "extractor/suffix_table.hpp"
|
#include "extractor/suffix_table.hpp"
|
||||||
#include "engine/guidance/route_step.hpp"
|
#include "engine/guidance/route_step.hpp"
|
||||||
@ -50,11 +51,11 @@ inline extractor::guidance::DirectionModifier::Enum getTurnDirection(const doubl
|
|||||||
return extractor::guidance::DirectionModifier::SharpRight;
|
return extractor::guidance::DirectionModifier::SharpRight;
|
||||||
if (angle >= 60 && angle < 140)
|
if (angle >= 60 && angle < 140)
|
||||||
return extractor::guidance::DirectionModifier::Right;
|
return extractor::guidance::DirectionModifier::Right;
|
||||||
if (angle >= 140 && angle < 170)
|
if (angle >= 140 && angle < 160)
|
||||||
return extractor::guidance::DirectionModifier::SlightRight;
|
return extractor::guidance::DirectionModifier::SlightRight;
|
||||||
if (angle >= 165 && angle <= 195)
|
if (angle >= 160 && angle <= 200)
|
||||||
return extractor::guidance::DirectionModifier::Straight;
|
return extractor::guidance::DirectionModifier::Straight;
|
||||||
if (angle > 190 && angle <= 220)
|
if (angle > 200 && angle <= 220)
|
||||||
return extractor::guidance::DirectionModifier::SlightLeft;
|
return extractor::guidance::DirectionModifier::SlightLeft;
|
||||||
if (angle > 220 && angle <= 300)
|
if (angle > 220 && angle <= 300)
|
||||||
return extractor::guidance::DirectionModifier::Left;
|
return extractor::guidance::DirectionModifier::Left;
|
||||||
|
Loading…
Reference in New Issue
Block a user