-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use enter + exit for roundabout instructions #4358
Conversation
| waypoints | route | turns | | ||
| b,d | bcegb,cd,cd | depart,exit rotary right,arrive | | ||
| b,f | bcegb,ef,ef | depart,exit rotary right,arrive | | ||
| b,h | bcegb,gh,gh | depart,exit rotary right,arrive | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just confused here, but understand the current expectation.
Would it make sense to add intermediate roundabout steps as Continue
and use number of such steps before Exit
instruction as an exit number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oxidase this is a special case about us only exiting the roundabout. The exit nr
is part of the actual instruction. The cucumber case simply does not repeat the exit, which is usually announced at the enter
instruction.
Do you think we would benefit a lot, from exposing exit-nr
in the exit-instruction
as well?
In terms of announcements, I would expect something like exit now
announced here, just for context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, it makes no sense to start on roundabout, but it is possible to make a re-routing request being inside a roundabout, so information about exit number will be very helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oxidase again, the exit number is part of the instruction. We can add it to cucumber as well. I would be careful, though, since the exit-number would change based on you driving in the roundabout.
So you may already have passed an exit before the route is in, you may have passed a second one before it is announced. So in case of re-routing on a roundabout, I would expect that exit now
would actually be more helpful than take the 3rd exit, which by now might be the first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for cleaning up tests. I have just small comments.
The discussion about exit numbers in exit instructions is up to you. Mainly it is the question do we want to have exit-nr on both enter/exit?
, but as soon we return numbers it is better to check in tests to avoid regressions even if it will be removed later.
const auto exit = std::count_if(begin, end, passes_exit_or_leaves_roundabout); | ||
|
||
// removes all intermediate instructions, assigns names and exit numbers | ||
BOOST_ASSERT(leavesRoundabout((end - 1)->maneuver.instruction)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would alias end - 1
as last
or back
if (currently_on_roundabout) | ||
currently_on_roundabout = !leavesRoundabout(step.maneuver.instruction); | ||
return result; | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
del
include/engine/api/route_api.hpp
Outdated
@@ -167,12 +167,13 @@ class RouteAPI : public BaseAPI | |||
* the overall response consistent. | |||
* | |||
* ⚠ CAUTION: order of post-processing steps is important | |||
* - postProcess must be called before collapseTurnInstructions that expects | |||
* - handleRoundabouts must be called before collapseTurnInstructions that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caution comment now can be removed
Ideally, I'd be looking for something like:
|
@bsudekum I was more looking for guidance on how you imagine the API response to look like. We currently have:
An alternative proposal would be:
(exit to be named appropriately). Also up for discussion: what flags do you need on the exit. |
One big blocker for this is that the new instruction type will break existing users of the OSRM v5.x API - they'll encounter the What about just issuing a regular Where it would get confusing I think would be small roundabouts, where the sequence of instructions would look like:
This seems like it would make sense as audible instructions (with (2) being announced inside the roundabout), but doesn't make a lot of sense as a sequence of written instructions. I think the new instruction type is ideal, but the compatibility changes concern me greatly. @MoKob @oxidase I don't see any discussion about the API compatibility of this change, have I missed something somewhere? Are there any pathological cases introduced by re-using the existing |
@danpat according to our API docs, issuing a
We require clients to fail gracefully back to |
I've updated the PR with some example situations and API responses. |
eb86e78
to
314bf51
Compare
@MoKob Heads up - I've just re-based this on |
if the roundabout tests are not specific to the car of bicycle profiles, i think it would be better to place then under features/testbot, rather than in features/car. |
@emiltin they are specific in that they need to be addressed in terms of flags (which the profiles have to do). Thus having a test showing that roundabouts are handled is fine. Though testing the same information (e.g. does counting work for different scenarios) is independent of the profile paths. If you transfer the roundabout flag, you will see the same specific handling. We could think about putting the main logic tests (e.g. rotary, roundabout turn... ) into the testbot profile and only ensure with basic tests that bike/car handle roundabouts correctly. |
Sorry for the delayed response; still slogging through vacation e-mail. 🙂
I think it’s OK to have
|
314bf51
to
9f8bdd3
Compare
9553043
to
8d5c2cf
Compare
Issue
Work towards #3108.
It contains two main parts:
The PR also removes a large set of duplicated tests. E.g.
circular
tests a lot of general roundabout behaviour. The only thing we need to test in addition to roundabouts is that the tag is recognised.The same goes for the bicycle profile, as long as we can detect a single roundabout, we do not need to repeat all tests for car, as the test processes the exact same steps.
Things to discuss:
immediately exit the roundabout
roundabout
exit-nr
on both enter/exit? I would argue that it might be adding more confusion than benefit when re-routing inside a roundaboutenter roundabout
instead ofroundabout
to be consistent withexit roundabout
Tasklist
Impact of this PR
Immediate exit from a rotary (or roundabout)
Enter And Exit Rotary
Only Exiting a Roundabout