osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.66k stars 1.02k forks source link

[Feature request] Give voice prompts to help get back to GPX track #2591

Closed annasoloviova closed 8 years ago

annasoloviova commented 8 years ago
  1. When a user wanders off the GXP track, they only get a voice prompt to get back. We should provide detailed instructions like if I make a left turn one street too soon, the app would say "you are off the route", "to get back on track, make a right at xxxx, then make a right onto xxxx..."
  2. Let skip a small section of the track. If providing detailed prompts is not an option, we can let users continue navigation along the track as soon as they get back on it.
vshcherb commented 8 years ago

Please test if we check option in GPX navigation settings (calculate OsmAnd route from beginning ) it works as Anna suggested.

sonora commented 8 years ago

@annasoloviova ; Anna, we have 3 additional settings appearing if someone choses to navigate along an existing GPX track: (1) Reverse GPX direction (not applicable here) (2) Pass along entire track (3) Calculate OsmAnd Route for first and last route segment (this is intended to "bridge" any gaps between start point and GPX track, or GP track and destination).

Un-checking (2) and checking (3) should actually solve the issue you are observing here, but I have to admit I have never tested this in practice.

Please try this with your use case, and I will try to create one myself do the same as soon as I get a chance.

Thx - Hardy

sonora commented 8 years ago

I took a long test trip today(120km), scenario and findings are as follows:

Scenario: I asked OsmAnd's offline router to calculate a CAR mode route from Point B to point F, it came out as follows:

Now I saved this route B2F.gpx via OsmAnd's "Save" mechanism.

Then I physically went to point

Settings were:"GPX route"=B2F.gpx, "Reverse GPX direction"=NO, "Pass along entire track"=NO, "Calculate OsmAnd route for first and last route segment"=YES.

Findings:

Now I deliberately left the route segment A-B and started an alternative (longer, off-route) way to reach C1.

Now I approached motorway exit C1, where I can join the "GPX portion" of the whole route.

I ignored the false direction and directly entered towards D.

I ignored this again, and finally when I was past Exit C2, OsmAnd acknowledged that I was on the right track and asked me to continue pursuing the route toward D.

Some time after leaving the second motorway at E, I deliberately took a wrong turn.

So if we look at this,

vshcherb commented 8 years ago

(9) I can't recall why but I don't think we pronounce tags for turns, I think it will be useful but there were some issues and I can't recall them. It should be easy to include onto A22 towards Rome. If we go for this decision then we will use our VoiceRouter to generate text.

(5), (6), (7) I'm afraid it will be hard to improve or I don't know the algorithm yet. Though we can always ignore some points after the closest but then we need to define how many so we don't end up OsmAnd routing instead of GPX :) 1km or more?

sonora commented 8 years ago

Regarding (9): Just pronouncing any odd <desc> text without knowing what it is and with what intention it was created could turn out a "grammatical nightmare" :) But, yes, producing text + tags ourselves which can be re-read and used by our voice router in the same fashion our offline router produces fully-featured voice prompts should not be too difficult.

(5), (6), (7): I agree, not very easy. and maybe not worth for many use cases where GPX files are used (unlike in my long-distance test trip): Like city or hiking tours, where short distances between GPX route points will either not matter, or can be detected by simply looking at the map. The algorithm would likely be to calculate 2 new routes via the 2 closest point on the GPX route, then selecting the faster one. This would likely detect that in the vast majority of cases the forward ("next") and not the backward ("previous") point on the GPX track should be targeted.

Any opinion on (3)? I think it may come from times when our GPX routing was way inferior (and following a GPX file sort of bogus-triggered a route recalculation all the time.), but changing it would need some testing.

vshcherb commented 8 years ago

I think (3) is supressed by mistake, cause now we say how far away the person is from the GPX route. So it might be interesting to hear recalculation as well.

sonora commented 8 years ago

I have removed the old restriction for (3), see https://github.com/osmandapp/Osmand/commit/4c88abff08c6dcdd9d56e730ba5866396f4fc93f.

I think we used to have this because without this restriction the prompt would have sounded continuously even while following the correct GPX route, and we did not have recalculation code for when using GPX routes anyway,

But maybe this is obsolete now, let's test.

sonora commented 8 years ago

I think the original issue is tested and works, small fix applied for the missing "route recalculated" voice prompt (3).

Issues (5), (6), (7), that re-routing does not evaluate if there is a "more forward" point on the GPX route to route you back onto, is a separate development story and not always significant.

Issue (9) is a finding on the side and relates to how we save our GPX routes to xml, respectively what data we could include to better use them also for voice guidance, but this is not related to this issue. We could potentially also include some traffic warnings etc. (see Issue #2843), but this would require a complete concept.

sonora commented 8 years ago

Researching (5), as a side effect of some other investigation:

Current algorithm is this: We find the closest point (often this is the perpendicular projection) on the GPX track to the start point (in nav mode: Where you are), and the route is calculated to contain that point. So if it happens to be only slightly "in the wrong direction" on the GPX track, when re-joining the GPX track OsmAnd first guides you in that "wrong direction", until the next turn point, then guides you back in the correct direction.

Sounds not impossible to fix, but in deed a better algorithm is not obvious. Maybe I find the time some day.

vshcherb commented 8 years ago

I think the situation that you are off the GPX route is already exceptional in sense if we get somehow to the GPX route , it is already good enough. In all other cases user need to use map and his vision how to get back to it. There is also an option "Calculate osmand route to the start and from the end of the GPX route" , which is useful in this situation

sonora commented 8 years ago

Yes, (5) is not a very pressing issue to fix for most users, and far from being high on my priority list to fix, too. Just wanted to record my findings here I had when fixing many things about our GPX route export this week, should I ever want to come back to this. Please note that issue (5) is of course exactly observed when "Calculate first and last segment" is used.