-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 compass bearing/direction when selecting start way #605
Comments
this is also needed in order to support 'turn around' instructions - if you're going in the wrong direction, and the first thing you need to do is to turn around. |
might even make computing paths faster, since you start the search in just one direction instead of both as is done now? |
I think that this needs to be extended to consider the case where the start is on a two way street, but you want the route to start in the bearing given other wise there may be an implied u-turn if the route start in the opposite direction indicated by the bearing. You might NOT want to make a u-turn but rather continue forward. think of a vehicle on a narrow street like a delivery truck of trash collection truck. |
wouldn't the decision to use a u-turn or not be indicated by the profile settings? with a delivery truck you might almost never want to do u-uturns, while it could be ok with a bike or on foot. |
Well yes, I guess from a behavior point of view, but I'm not sure how that translates into the routing engine. In one case you want the routing engine to say your shortest distance requires you to turn around, in the other case you are not allowed to turn around and the route MUST start in the direction of the bearing and continue forward finding the best path to the next point which might be behind you and require you to drive around the block to get to it. There is a big difference (in my mind) from computing the shortest path and inserting a instruction to turn around vs computing a path that starts in a given direction and not in the reverse direction which might be shorter if you didn't care. I'm good with the idea, just pointing out a potential issue/difference that might need to be addressed. |
Maybe the profile could have a penalty for u-turns at start and via points? |
yes, I was thinking of applying a U-turn penalty depending on the deviation from a true 180 degrees turn. |
that could be handled by the turn penalty function? maybe we could pass an argument to the turn function indicating whether the turn is happening at a via point or start point? |
Comments from #1413 by @woodbri : Comments from #1413 by @systemd i.e. when planning a route from (lat1,lon1 heading east) to (lat2,lon2 heading east), start with the carriageway nearest to lat1,lon1 which has an eastbound one-way direction, even if the other carriageway is slightly nearer lat1,lon1. |
Adding another idea and use case. When computing routes we need to be able to indicate which side of the street the stop or via location is on so that the route can only approach the stop moving in a direction that puts the passenger side of the vehicle facing that side of the road. The use case for this is bus stops or trash collection containers or delivery van, taxi, etc on a two way streets. One way of handling this conceptually without breaking the existing api, is to add a flag to indicate the behavior is desired, then when a point is used to create a phantom node, extend that structure to indicate side or the implied direction based on the side and chase that through the code. |
Current brain dump on how to implement this:
|
see #515 for an issue related to left/right side of the road |
Besides routes, I suggest having bearing/direction added to the /match and /locate OSRM resources too, as it could help improve accuracy for those resources. |
good point |
This has been implemented. |
great |
Awesome. Is there a release version or do I just grab the latest version of the source to test? |
It's currently sitting in the |
Is the match plugin also updated to include this as an input or output parameter? |
It is only the match plugin that exposes this behaviour right now. It should be easy to add to the other plugins how that the RTree changes are in place, I just haven't made the time. Patches welcome. Example usage:
By default, if you supply a bearing, it will match edges that are +/- 10 degrees of the supplied value. That value is hard-coded at the moment. |
it would be great to have this for viaroute as well. in fact this issue originally referred to that usage, so not sure it should be closed? choosing the best matching way, rather than using a fixed angle might be useful. |
@emiltin We discussed that, but couldn't come up with a good heuristic for "best way". The r-tree search iteratively finds edges ranked by distance. What's better? A nearby match with a poor bearing, or a far away match with a tight bearing? In the end, we decided to simply make it a filter, rather than a ranking criteria. |
my feeling is it should be possible to find a sensible heuristic. did you try somethink like distance^2 * angle_distance^2? |
if several ways are below the angle treshold, which will be picked? |
my experience is that bearing from mobile devices is often quite inaccurate. i think a filter of 10 degrees would mean you most of the time would get no match (thinking about the viaroute use-case here) |
It's a currently a simple filter. The closest way that's below the threshold will be chosen. The use-case that motivated doing this was map-matching OpenLR (http://www.openlr.org/) traffic section descriptors against the map. OpenLR supplies a heading hint, and it's not based on real-world sensor data, it's a strict bearing based on the map geometry. I wonder if what we really need here are two different types of bearing parameters:
What we've done is |
i see about openLR. |
I think a new, more specific ticket would be best. |
Thanks everyone. Does the new version of the match plugin also return the corrected bearing along with lat/lon for each point? Assuming I send a bearing with each lat/lon/t parameter, I'd like to see the mapmatched/corrected bearing in the response. |
Does anyone have an anticipiated release date for when the next version of OSRM Backend that includes this feature will be created? |
for mobile use, it would be very useful if you could pass the compass bearing when specifying the start location.
otherwise GPS imprecision can easily cause the start point to be located in the wrong direction of way that's split into two oneways. this results in confusing routes that start out in the wrong direction.
it could be an optional parameter to the nearest, locate and/or viaroute requests. i imagine something like:
idea originally mentioned in:
#204
OpenLR does something similar, but uses other information too:
http://openlr.org/
The text was updated successfully, but these errors were encountered: