From 1955dcddb3cdf3782041a60cb7073ca0c2fe2612 Mon Sep 17 00:00:00 2001 From: DeltaDizzy Date: Sun, 1 Jun 2025 18:46:54 -0500 Subject: [PATCH] [wpimath] Fix SimpleMotorFeedforward no-accel overload returning negative voltage outputs (#7999) SimpleMotorFeedforward::calculate(velocity) was not updated to account for the removal of calculate(velocity, acceleration), so it would pass currentVelocity = velocity and nextVelocity = 0, resulting in negative outputs in many scenarios. --- .../edu/wpi/first/math/controller/SimpleMotorFeedforward.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/SimpleMotorFeedforward.java b/wpimath/src/main/java/edu/wpi/first/math/controller/SimpleMotorFeedforward.java index 36bab653c9..12aae3f91d 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/SimpleMotorFeedforward.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/SimpleMotorFeedforward.java @@ -157,7 +157,7 @@ public class SimpleMotorFeedforward implements ProtobufSerializable, StructSeria * @return The computed feedforward. */ public double calculate(double velocity) { - return calculate(velocity, 0); + return calculate(velocity, velocity); } /**