From e4f8ed210b2d457b02edaa5a5f026ffb8d9ebb45 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Thu, 5 Dec 2024 00:12:03 -0800 Subject: [PATCH] [wpimath] Improve SimpleMotorFeedforward argument names and deprecation message --- .../math/controller/SimpleMotorFeedforward.java | 12 ++++++------ .../include/frc/controller/SimpleMotorFeedforward.h | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) 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 9356481ffa0..a075af0c092 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 @@ -150,7 +150,7 @@ public double calculate(double velocity, double acceleration) { * * @param velocity The velocity setpoint. * @return The computed feedforward. - * @deprecated Use the current/next velocity overload instead. + * @deprecated Use the unit-taking velocity overload instead. */ @SuppressWarnings("removal") @Deprecated(forRemoval = true, since = "2025") @@ -159,15 +159,15 @@ public double calculate(double velocity) { } /** - * Calculates the feedforward from the gains and setpoints assuming discrete control when the - * setpoint does not change. + * Calculates the feedforward from the gains and velocity setpoint assuming discrete control when + * the velocity setpoint does not change. * * @param The velocity parameter either as distance or angle. - * @param setpoint The velocity setpoint. + * @param velocity The velocity setpoint. * @return The computed feedforward. */ - public Voltage calculate(Measure> setpoint) { - return calculate(setpoint, setpoint); + public Voltage calculate(Measure> velocity) { + return calculate(velocity, velocity); } /** diff --git a/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h b/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h index 932172810df..87099047f5b 100644 --- a/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h @@ -84,14 +84,15 @@ class SimpleMotorFeedforward { } /** - * Calculates the feedforward from the gains and setpoint assuming discrete - * control. Use this method when the setpoint does not change. + * Calculates the feedforward from the gains and velocity setpoint assuming + * discrete control. Use this method when the velocity setpoint does not + * change. * - * @param setpoint The velocity setpoint. + * @param velocity The velocity setpoint. * @return The computed feedforward, in volts. */ - constexpr units::volt_t Calculate(units::unit_t setpoint) const { - return Calculate(setpoint, setpoint); + constexpr units::volt_t Calculate(units::unit_t velocity) const { + return Calculate(velocity, velocity); } /**