rework for vh on roundabouts #664

This commit is contained in:
afischerdev 2024-01-30 18:12:51 +01:00
parent e73d0e8001
commit b3002a78e3

View file

@ -98,10 +98,10 @@ public final class VoiceHintProcessor {
} }
if (roundaboutExit > 0) { if (roundaboutExit > 0) {
roundAboutTurnAngle += sumNonConsumedWithinCatchingRange(inputs, hintIdx); roundAboutTurnAngle += sumNonConsumedWithinCatchingRange(inputs, hintIdx);
double startTurn = (roundaboudStartIdx != -1 ? inputs.get(roundaboudStartIdx).goodWay.turnangle : turnAngle); double startTurn = (roundaboudStartIdx != -1 ? inputs.get(roundaboudStartIdx + 1).goodWay.turnangle : turnAngle);
input.angle = roundAboutTurnAngle; input.angle = roundAboutTurnAngle;
input.distanceToNext = distance; input.distanceToNext = distance;
input.roundaboutExit = startTurn < 0 ? -roundaboutExit : roundaboutExit; input.roundaboutExit = startTurn < 0 ? roundaboutExit : -roundaboutExit;
distance = 0.; distance = 0.;
results.add(input); results.add(input);
roundAboutTurnAngle = 0.f; roundAboutTurnAngle = 0.f;
@ -284,15 +284,14 @@ public final class VoiceHintProcessor {
inputLastSaved.distanceToNext += input.distanceToNext; inputLastSaved.distanceToNext += input.distanceToNext;
} }
} }
} } else {
else {
// add all others // add all others
// ignore motorway / primary continue // ignore motorway / primary continue
if ( if (((input.goodWay.getPrio() != 28) &&
((input.goodWay.getPrio() != 28) && (input.goodWay.getPrio() != 30) &&
(input.goodWay.getPrio() != 30) && (input.goodWay.getPrio() != 26))
(input.goodWay.getPrio() != 26)) || input.isRoundabout()
|| Math.abs(input.angle) > 5.f) { // motorway / primary exit || Math.abs(input.angle) > 21.f) {
results.add(input); results.add(input);
inputLastSaved = input; inputLastSaved = input;
} else { } else {
@ -314,8 +313,7 @@ public final class VoiceHintProcessor {
if (input.goodWay.getPrio() < input.maxBadPrio) { if (input.goodWay.getPrio() < input.maxBadPrio) {
if (inputLastSaved != null && inputLastSaved.cmd != VoiceHint.C if (inputLastSaved != null && inputLastSaved.cmd != VoiceHint.C
&& (inputLastSaved != null && inputLastSaved.distanceToNext > minRange) && (inputLastSaved != null && inputLastSaved.distanceToNext > minRange)
&& transportMode != VoiceHintList.TRANS_MODE_CAR) && transportMode != VoiceHintList.TRANS_MODE_CAR) {
{
// add when straight and not linktype // add when straight and not linktype
// and last vh not straight // and last vh not straight
save = true; save = true;
@ -353,8 +351,8 @@ public final class VoiceHintProcessor {
// add when angle above 22.5 deg // add when angle above 22.5 deg
save = true; save = true;
} else if (Math.abs(input.angle) < SIGNIFICANT_ANGLE) { } else if (Math.abs(input.angle) < SIGNIFICANT_ANGLE) {
// add when angle below 22.5 deg // add when angle below 22.5 deg ???
save = true; // save = true;
} else { } else {
// otherwise ignore but add distance to next // otherwise ignore but add distance to next
if (nextInput != null) { // when drop add distance to last if (nextInput != null) { // when drop add distance to last