Skip to content
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

Rework on voicehint process #613

Closed
afischerdev opened this issue Aug 16, 2023 · 13 comments
Closed

Rework on voicehint process #613

afischerdev opened this issue Aug 16, 2023 · 13 comments
Milestone

Comments

@afischerdev
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link

0709wiwiwi commented Aug 25, 2023

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)

  • TTS by small distance: After 30 meters turn left (TTS)
  • TTS last announcement: left (TTS) As compact as possible !
  • TTS by small distance: After 30 meters track at 9 o’ clock (TTS)
  • TTS last announcement: track at 9 (TTS) As compact as possible !
    Alternatively the last announcement as a loud and clear compact Morse beep “T” - “dash”
    Uploading Beeline_clock_sym_guiding.docx…

@afischerdev
Copy link
Collaborator Author

Two new samples from #625:

  1. turn instruction left with starting straight
  2. missing turn instruction sample

@afischerdev
Copy link
Collaborator Author

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 afischerdev changed the title Rework on voicehint postprocess Rework on voicehint process Sep 20, 2023
@afischerdev
Copy link
Collaborator Author

afischerdev commented Oct 6, 2023

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
Copy link
Collaborator

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
Copy link
Contributor

@afischerdev seems like a working solution:

  • We get the currently missing instructions (as shown in the right images)
  • Then we can post-process them and exclude the nearby straight instructions

@afischerdev
Copy link
Collaborator Author

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

@devemux86
Copy link
Contributor

devemux86 commented Dec 8, 2023

@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
Copy link
Collaborator Author

@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
Copy link
Contributor

devemux86 commented Dec 8, 2023

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

@afischerdev
Copy link
Collaborator Author

afischerdev commented Dec 22, 2023

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

  • show 'continue' only if the way crosses a higher priority way
  • roundabouts have an exit marker
  • u-turn between -179 and +179 degree
  • merge two hints when near to each other - e.g. left, left to u-turn left
  • marker when highway exit and continue nearly same direction
  • beeline goes direct from via to via point

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

  • add voice hint to the list when it passes the first control
    rules are around the good way/bad way turn angles, priorities or link to highway
    only small changes here - e.g. enable the left turn (see above)

  • remove voice hint from list when it passes the second control
    here we check the old rules (ignore roundabouts and beeline at the moment)
    these rules need some updates

    • show 'continue'
      only if the way crosses a higher priority way
      and ignore a possible second crossing
      and ignore on tranport mode car when near to an other voice hint
    • merge two hints when near to each other
      use e.g. left / left = u-turn only for transport mode car
      use e.g. left / right = straight only for minimal range (different on foot, bike, car)

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
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants