diff --git a/brouter-core/src/main/java/btools/router/VoiceHint.java b/brouter-core/src/main/java/btools/router/VoiceHint.java index 691453c..09d38ca 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHint.java +++ b/brouter-core/src/main/java/btools/router/VoiceHint.java @@ -580,7 +580,11 @@ public class VoiceHint { } else if (lowerBadWayAngle >= -100.f && higherBadWayAngle < 45.f) { cmd = KL; } else { - cmd = C; + if (lowerBadWayAngle > -35.f && higherBadWayAngle > 55.f) { + cmd = KR; + } else { + cmd = C; + } } } else if (cmdAngle < 5.f) { if (lowerBadWayAngle > -30.f) { @@ -597,7 +601,11 @@ public class VoiceHint { } else if (lowerBadWayAngle > -45.f && higherBadWayAngle <= 100.f) { cmd = KR; } else { - cmd = C; + if (lowerBadWayAngle < -55.f && higherBadWayAngle < 35.f) { + cmd = KL; + } else { + cmd = C; + } } } else if (cmdAngle < 45.f) { cmd = TSLR; diff --git a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java index 5df8a67..83a2ad4 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java +++ b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java @@ -116,6 +116,7 @@ public final class VoiceHintProcessor { input.angle = roundAboutTurnAngle; input.goodWay.turnangle = roundAboutTurnAngle; input.distanceToNext = distance; + input.turnAngleConsumed = true; //input.roundaboutExit = startTurn < 0 ? roundaboutExit : -roundaboutExit; input.roundaboutExit = roundAboutTurnAngle < 0 ? roundaboutExit : -roundaboutExit; float tmpangle = 0; @@ -314,7 +315,13 @@ public final class VoiceHintProcessor { input.cmd == VoiceHint.KR || input.cmd == VoiceHint.KL) && !input.goodWay.isLinktType()) { - if (input.goodWay.getPrio() < input.maxBadPrio && (inputLastSaved != null && inputLastSaved.distanceToNext > catchingRange)) { + if ( + ((Math.abs(input.lowerBadWayAngle) < 35.f || + input.higherBadWayAngle < 35.f) + || input.goodWay.getPrio() < input.maxBadPrio) + && (inputLastSaved != null && inputLastSaved.distanceToNext > minRange) + && (input.distanceToNext > minRange) + ) { results.add(input); } else { if (inputLast != null) { // when drop add distance to last diff --git a/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java b/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java index 630af03..e94677e 100644 --- a/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java +++ b/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java @@ -782,7 +782,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier { public void parseFile(File file, String readOnlyContext, Map keyValues) { if (!file.exists()) { - throw new IllegalArgumentException("profile " + file + " does not exist"); + throw new IllegalArgumentException("profile " + file.getName() + " does not exist"); } try { if (readOnlyContext != null) { @@ -813,12 +813,12 @@ public abstract class BExpressionContext implements IByteArrayUnifier { variableData[i] = readOnlyData[i]; } } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("ParseException " + file + " at line " + linenr + ": " + e.getMessage()); + throw new IllegalArgumentException("ParseException " + file.getName() + " at line " + linenr + ": " + e.getMessage()); } catch (Exception e) { throw new RuntimeException(e); } if (expressionList.size() == 0) { - throw new IllegalArgumentException(file.getAbsolutePath() + throw new IllegalArgumentException(file.getName() + " does not contain expressions for context " + context + " (old version?)"); } }