diff --git a/CHANGELOG.md b/CHANGELOG.md index f8b324baf..6881740e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 5.4.3 + - Changes from 5.4.1 + - Bugfixes + - #3254 Fixed a bug that could end up hiding roundabout instructions + # 5.4.2 - Changes from 5.4.1 - Bugfixes diff --git a/features/guidance/roundabout.feature b/features/guidance/roundabout.feature index a02c762be..efd285fec 100644 --- a/features/guidance/roundabout.feature +++ b/features/guidance/roundabout.feature @@ -403,3 +403,78 @@ Feature: Basic Roundabout #| w,x | ll,egg,egg,tr,tr | depart,roundabout-exit-1,roundabout-exit-2,arrive | | w,x | ll,egg,egg,tr,tr | depart,turn right,continue left,turn slight left,arrive | +<<<<<<< HEAD +======= + Scenario: Use Lane in Roundabout + Given the node map + """ + . i . . . .. . + .' '. + a - b. f - g + . | + '. 1 / + '. / + j - - - c . . e + ' d ' + ' h + """ + + #using roundabout as name, we can ignore whether we see a roundabout or a rotary here. Cucumber output will be the same + And the ways + | nodes | junction | name | oneway | turn:lanes:forward | + | ba | | left-out | yes | | + | jc | | left-in | yes | | + | dh | | right-bot-out | yes | | + | fg | | right-top-out | yes | | + | bc | roundabout | roundabout | yes | left;through\|through | + | cdefib | roundabout | roundabout | yes | | + + When I route I should get + | waypoints | route | turns | + | 1,h | roundabout,right-bot-out,right-bot-out | depart,roundabout-exit-1,arrive | + + @3254 + Scenario: Driving up to and through a roundabout + Given the node map + | | g | | | | | | | a | | | | | + | | | | | | | | | | | | | | + | e | f | | | | | b | | | | d | | h | + | | | | | | | | | | | | | | + | | i | | | | | | | c | | | | | + | | | | | | | | | | | | | | + | | | | | | | | | k | | | | | + + And the ways + | nodes | junction | name | highway | + | abcda | roundabout | roundabout | residential | + | gfi | | side | residential | + | efb | | left | residential | + | dh | | right | residential | + | ck | | bottom | residential | + + When I route I should get + | waypoints | route | turns | + | e,h | left,right,right | depart,roundabout-exit-2,arrive | + + @3254 + Scenario: Driving up to and through a roundabout + Given the node map + | | g | | | | a | | | | | + | | | | | | | | | | | + | e | f | | b | | | | d | | h | + | | | | | | | | | | | + | | i | | | | c | | | | | + | | | | | | | | | | | + | | | | | | k | | | | | + + And the ways + | nodes | junction | name | highway | + | abcda | roundabout | roundabout | residential | + | gfi | | side | residential | + | efb | | left | residential | + | dh | | right | residential | + | ck | | bottom | residential | + + When I route I should get + | waypoints | route | turns | + | e,h | left,right,right | depart,roundabout-exit-2,arrive | diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp index 21f7a3d9b..a6bd1a12c 100644 --- a/src/engine/guidance/post_processing.cpp +++ b/src/engine/guidance/post_processing.cpp @@ -355,6 +355,10 @@ void collapseTurnAt(std::vector &steps, BOOST_ASSERT(one_back_index < steps.size()); const auto ¤t_step = steps[step_index]; const auto &one_back_step = steps[one_back_index]; + // Don't collapse roundabouts + if (entersRoundabout(current_step.maneuver.instruction) || + entersRoundabout(one_back_step.maneuver.instruction)) + return; // FIXME: this function assumes driving on the right hand side of the streat const auto bearingsAreReversed = [](const double bearing_in, const double bearing_out) { @@ -521,6 +525,11 @@ void collapseTurnAt(std::vector &steps, // bool isStaggeredIntersection(const RouteStep &previous, const RouteStep ¤t) { + //don't touch roundabouts + if (entersRoundabout(previous.maneuver.instruction) || + entersRoundabout(current.maneuver.instruction)) + return false; + // Base decision on distance since the zig-zag is a visual clue. // If adjusted, make sure to check validity of the is_right/is_left classification below const constexpr auto MAX_STAGGERED_DISTANCE = 3; // debatable, but keep short to be on safe side