[wpilib] Clamp sim battery voltage to 0 (#7325)

This commit is contained in:
Jade
2024-11-04 02:37:44 +08:00
committed by GitHub
parent 23e71e10e4
commit debb52156c
2 changed files with 8 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ public final class BatterySim {
for (var current : currents) {
retval -= current * resistanceOhms;
}
return retval;
return Math.max(0.0, retval);
}
/**