From 85ea5f84976c6af87b40dbfb5603673bbdbb854b Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Sun, 24 Mar 2024 23:50:41 -0700 Subject: [PATCH] [wpimath] Make more LinearSystemId functions not throw if Kv = 0 (#6465) --- .../java/edu/wpi/first/math/system/plant/LinearSystemId.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpimath/src/main/java/edu/wpi/first/math/system/plant/LinearSystemId.java b/wpimath/src/main/java/edu/wpi/first/math/system/plant/LinearSystemId.java index bff21492ef..6d8e39a23e 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/system/plant/LinearSystemId.java +++ b/wpimath/src/main/java/edu/wpi/first/math/system/plant/LinearSystemId.java @@ -262,7 +262,7 @@ public final class LinearSystemId { * @see https://github.com/wpilibsuite/sysid */ public static LinearSystem identifyVelocitySystem(double kV, double kA) { - if (kV <= 0.0) { + if (kV < 0.0) { throw new IllegalArgumentException("Kv must be greater than or equal to zero."); } if (kA <= 0.0) { @@ -295,7 +295,7 @@ public final class LinearSystemId { * @see https://github.com/wpilibsuite/sysid */ public static LinearSystem identifyPositionSystem(double kV, double kA) { - if (kV <= 0.0) { + if (kV < 0.0) { throw new IllegalArgumentException("Kv must be greater than or equal to zero."); } if (kA <= 0.0) {