abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
494 stars 118 forks source link

Rework on voicehint process #613

Closed afischerdev closed 6 months ago

afischerdev commented 1 year ago

It seems the post process for voicehint generation needs a rework. Please see doc for voicehint for the current rules.

Related to this discussion in Cruiser forum we have some smaller irritation for the users (I hope I got it correct):

Sample Result Expected Result
1. sample left, continue left
2. sample continue, left left
1. sample with trekking continue, left, continue, continue left
3. sample u-turn continue, u-turn-left, continue u-turn-left
4. sample u-turn u-turn-left u-turn-left

The rule keep continue when bad way is on higher prio is working fine. But it has its side effects.

Are there any other examples that should be revised as well?

afischerdev commented 1 year ago

An other point for this rework is the handling of two near turn instructions left/right. Here two examples 5 meter difference - result for all straight 7 meter distance - result for trekking right/left, for car straight

The different results come from the minimal distance table: foot = 3m - with a speed of 5 km/h we have 1,4 m/s = 7 meter cost 5 seconds bike = 5 m - speed 10 km/h - 2,8 m/s = 2.5 seconds car = 20 m - speed 30 km/h - 8,3 m/s = 0.8 seconds I don't know how long a sentence like 'turn left and follow for 7 meter' will take in audio but I guess on a car driving you will not hear very much.

0709wiwiwi commented 1 year ago

I don't know how long a sentence like 'turn left and follow for 7 meter' will take in audio but I guess on a car driving you will not hear very much.

The last announcement before turns should be very short and clear. Example: (slow_speed)

afischerdev commented 1 year ago

Two new samples from #625:

  1. turn instruction left with starting straight
  2. missing turn instruction sample
afischerdev commented 1 year ago

During my research for this issue I found further inconsistencies - like the number 2 above. Some hints are dropped like this right instruction This means to me it is not only a postprocess problem.

afischerdev commented 1 year ago

Sample 2 above: in my eyes the exclusion of this voicehint is done in VoicehintProcessor.

boolean hasSomethingMoreStraight = (Math.abs(turnAngle) - minAbsAngeRaw) > 20.; The angles are turnAngle= -88 minAbsAngeRaw= 180, so the result is -92

I didn't use a correction on this for now - just to keep the results comparable. But I used a new logic in post process. In the past we had a collection of nearby voicehints, now I tried a comparing of two voicehints a time. This brings better results and make lost voichints visible. Here a the results of differents on this track current logic against new one.

left = old

track_diff_11

track_diff_19

track_diff_397

track_diff_480

track_diff_518

The source is located in my repo

Before I go on with the 'left' problem and the exclusion of the straight voicehints in nearby situation, I like to hear what you are thinking about. Is this a way it could go?

quaelnix commented 11 months ago

I did not expect the u-turn hint in the second last example and the two straight hints in the last example, but overall I think this is the way to go. However I don't understand the source from just looking at it. Maybe we should document the logic somewhere?

devemux86 commented 10 months ago

@afischerdev seems like a working solution:

afischerdev commented 10 months ago

@devemux86 Please hang on a minute. I'll continue here in a few days.

devemux86 commented 10 months ago

@afischerdev

A Beta version of Cruiser is available where I post process the turn instructions to fix the nearby "continue":

(this works in Cruiser code on top of any routing service)

afischerdev commented 10 months ago

@devemux86 Hmm, interesting thing. Good to know that clients can protect that as well. Anyway I think there is still some work for BRouter.

devemux86 commented 10 months ago

More examples of routes missing a "turn left" instruction were reported:

afischerdev commented 9 months ago

Next version for voice hints

The first step was to start a new transportMode - announced here #544 But this changes only the internal use, no changes in profile at the moment

To remenber the old rules from doc

There are two steps of control for the voice hint list:

Results for trekking samples above: New_58 New_393 New_479 New_518

For a closer look: Here are the comparable GPX files in new and old version. In the new versions the voice hints have an additional point name to have an easy entry for a point discussion.

testtrack0.trekking_old.gpx.txt testtrack0.trekking_new.gpx.txt

testtrack0.car_old.gpx.txt testtrack0.car_new.gpx.txt

testtrack0.hiking_old.gpx.txt testtrack0.hiking_new.gpx.txt

The samples uses all the same coordinates Darmstadt to Heidelberg Please don't look at the routing results, focus only to voicehints.

The source for this you find as before here

So have fun the next days.

afischerdev commented 8 months ago

For the new issue #664 I changed the voicehint calculation on roundabouts. I did it in this repository because I'm on the way to do a PR for this new features.