Merge pull request #806 from afischerdev/lib-workaround

Lib small workaround
This commit is contained in:
afischerdev 2025-07-07 13:02:02 +02:00 committed by GitHub
commit fcc0d5ce60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 6 deletions

View file

@ -579,9 +579,13 @@ public class VoiceHint {
cmd = TSLL; cmd = TSLL;
} else if (lowerBadWayAngle >= -100.f && higherBadWayAngle < 45.f) { } else if (lowerBadWayAngle >= -100.f && higherBadWayAngle < 45.f) {
cmd = KL; cmd = KL;
} else {
if (lowerBadWayAngle > -35.f && higherBadWayAngle > 55.f) {
cmd = KR;
} else { } else {
cmd = C; cmd = C;
} }
}
} else if (cmdAngle < 5.f) { } else if (cmdAngle < 5.f) {
if (lowerBadWayAngle > -30.f) { if (lowerBadWayAngle > -30.f) {
cmd = KR; cmd = KR;
@ -596,9 +600,13 @@ public class VoiceHint {
cmd = TSLR; cmd = TSLR;
} else if (lowerBadWayAngle > -45.f && higherBadWayAngle <= 100.f) { } else if (lowerBadWayAngle > -45.f && higherBadWayAngle <= 100.f) {
cmd = KR; cmd = KR;
} else {
if (lowerBadWayAngle < -55.f && higherBadWayAngle < 35.f) {
cmd = KL;
} else { } else {
cmd = C; cmd = C;
} }
}
} else if (cmdAngle < 45.f) { } else if (cmdAngle < 45.f) {
cmd = TSLR; cmd = TSLR;
} else if (cmdAngle < 135.f) { } else if (cmdAngle < 135.f) {

View file

@ -116,6 +116,7 @@ public final class VoiceHintProcessor {
input.angle = roundAboutTurnAngle; input.angle = roundAboutTurnAngle;
input.goodWay.turnangle = roundAboutTurnAngle; input.goodWay.turnangle = roundAboutTurnAngle;
input.distanceToNext = distance; input.distanceToNext = distance;
input.turnAngleConsumed = true;
//input.roundaboutExit = startTurn < 0 ? roundaboutExit : -roundaboutExit; //input.roundaboutExit = startTurn < 0 ? roundaboutExit : -roundaboutExit;
input.roundaboutExit = roundAboutTurnAngle < 0 ? roundaboutExit : -roundaboutExit; input.roundaboutExit = roundAboutTurnAngle < 0 ? roundaboutExit : -roundaboutExit;
float tmpangle = 0; float tmpangle = 0;
@ -314,7 +315,13 @@ public final class VoiceHintProcessor {
input.cmd == VoiceHint.KR || input.cmd == VoiceHint.KR ||
input.cmd == VoiceHint.KL) input.cmd == VoiceHint.KL)
&& !input.goodWay.isLinktType()) { && !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); results.add(input);
} else { } else {
if (inputLast != null) { // when drop add distance to last if (inputLast != null) { // when drop add distance to last

View file

@ -782,7 +782,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier {
public void parseFile(File file, String readOnlyContext, Map<String, String> keyValues) { public void parseFile(File file, String readOnlyContext, Map<String, String> keyValues) {
if (!file.exists()) { if (!file.exists()) {
throw new IllegalArgumentException("profile " + file + " does not exist"); throw new IllegalArgumentException("profile " + file.getName() + " does not exist");
} }
try { try {
if (readOnlyContext != null) { if (readOnlyContext != null) {
@ -813,12 +813,12 @@ public abstract class BExpressionContext implements IByteArrayUnifier {
variableData[i] = readOnlyData[i]; variableData[i] = readOnlyData[i];
} }
} catch (IllegalArgumentException e) { } 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) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
if (expressionList.size() == 0) { if (expressionList.size() == 0) {
throw new IllegalArgumentException(file.getAbsolutePath() throw new IllegalArgumentException(file.getName()
+ " does not contain expressions for context " + context + " (old version?)"); + " does not contain expressions for context " + context + " (old version?)");
} }
} }