diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/ArmFeedforward.java b/wpimath/src/main/java/edu/wpi/first/math/controller/ArmFeedforward.java index af30cdbbdf..bf50a0c521 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/ArmFeedforward.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/ArmFeedforward.java @@ -86,15 +86,6 @@ public class ArmFeedforward implements ProtobufSerializable, StructSerializable this(ks, kg, kv, 0); } - /** - * Returns the static gain in volts. - * - * @return The static gain in volts. - */ - public double getKs() { - return ks; - } - /** * Sets the static gain. * @@ -104,15 +95,6 @@ public class ArmFeedforward implements ProtobufSerializable, StructSerializable this.ks = ks; } - /** - * Returns the gravity gain in volts. - * - * @return The gravity gain in volts. - */ - public double getKg() { - return kg; - } - /** * Sets the gravity gain. * @@ -122,15 +104,6 @@ public class ArmFeedforward implements ProtobufSerializable, StructSerializable this.kg = kg; } - /** - * Returns the velocity gain in V/(rad/s). - * - * @return The velocity gain. - */ - public double getKv() { - return kv; - } - /** * Sets the velocity gain. * @@ -140,6 +113,42 @@ public class ArmFeedforward implements ProtobufSerializable, StructSerializable this.kv = kv; } + /** + * Sets the acceleration gain. + * + * @param ka The acceleration gain in V/(rad/s²). + */ + public void setKa(double ka) { + this.ka = ka; + } + + /** + * Returns the static gain in volts. + * + * @return The static gain in volts. + */ + public double getKs() { + return ks; + } + + /** + * Returns the gravity gain in volts. + * + * @return The gravity gain in volts. + */ + public double getKg() { + return kg; + } + + /** + * Returns the velocity gain in V/(rad/s). + * + * @return The velocity gain. + */ + public double getKv() { + return kv; + } + /** * Returns the acceleration gain in V/(rad/s²). * @@ -149,15 +158,6 @@ public class ArmFeedforward implements ProtobufSerializable, StructSerializable return ka; } - /** - * Sets the acceleration gain. - * - * @param ka The acceleration gain in V/(rad/2²). - */ - public void setKa(double ka) { - this.ka = ka; - } - /** * Returns the period in seconds. * diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/ElevatorFeedforward.java b/wpimath/src/main/java/edu/wpi/first/math/controller/ElevatorFeedforward.java index 816d2bb086..e33de90b15 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/ElevatorFeedforward.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/ElevatorFeedforward.java @@ -86,15 +86,6 @@ public class ElevatorFeedforward implements ProtobufSerializable, StructSerializ this(ks, kg, kv, 0); } - /** - * Returns the static gain in volts. - * - * @return The static gain in volts. - */ - public double getKs() { - return ks; - } - /** * Sets the static gain. * @@ -104,15 +95,6 @@ public class ElevatorFeedforward implements ProtobufSerializable, StructSerializ this.ks = ks; } - /** - * Returns the gravity gain in volts. - * - * @return The gravity gain in volts. - */ - public double getKg() { - return kg; - } - /** * Sets the gravity gain. * @@ -122,6 +104,42 @@ public class ElevatorFeedforward implements ProtobufSerializable, StructSerializ this.kg = kg; } + /** + * Sets the velocity gain. + * + * @param kv The velocity gain in V/(m/s). + */ + public void setKv(double kv) { + this.kv = kv; + } + + /** + * Sets the acceleration gain. + * + * @param ka The acceleration gain in V/(m/s²). + */ + public void setKa(double ka) { + this.ka = ka; + } + + /** + * Returns the static gain in volts. + * + * @return The static gain in volts. + */ + public double getKs() { + return ks; + } + + /** + * Returns the gravity gain in volts. + * + * @return The gravity gain in volts. + */ + public double getKg() { + return kg; + } + /** * Returns the velocity gain in V/(m/s). * @@ -131,15 +149,6 @@ public class ElevatorFeedforward implements ProtobufSerializable, StructSerializ return kv; } - /** - * Sets the velocity gain. - * - * @param kv The velocity gain in V/(rad/s). - */ - public void setKv(double kv) { - this.kv = kv; - } - /** * Returns the acceleration gain in V/(m/s²). * @@ -149,15 +158,6 @@ public class ElevatorFeedforward implements ProtobufSerializable, StructSerializ return ka; } - /** - * Sets the acceleration gain. - * - * @param ka The acceleration gain in V/(rad/2²). - */ - public void setKa(double ka) { - this.ka = ka; - } - /** * Returns the period in seconds. * 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 73ff6dc342..10540a2e18 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 @@ -83,15 +83,6 @@ public class SimpleMotorFeedforward implements ProtobufSerializable, StructSeria this(ks, kv, 0); } - /** - * Returns the static gain in volts. - * - * @return The static gain in volts. - */ - public double getKs() { - return ks; - } - /** * Sets the static gain. * @@ -101,6 +92,33 @@ public class SimpleMotorFeedforward implements ProtobufSerializable, StructSeria this.ks = ks; } + /** + * Sets the velocity gain. + * + * @param kv The velocity gain in V/(units/s). + */ + public void setKv(double kv) { + this.kv = kv; + } + + /** + * Sets the acceleration gain. + * + * @param ka The acceleration gain in V/(units/2²). + */ + public void setKa(double ka) { + this.ka = ka; + } + + /** + * Returns the static gain in volts. + * + * @return The static gain in volts. + */ + public double getKs() { + return ks; + } + /** * Returns the velocity gain in V/(units/s). * @@ -112,15 +130,6 @@ public class SimpleMotorFeedforward implements ProtobufSerializable, StructSeria return kv; } - /** - * Sets the velocity gain. - * - * @param kv The velocity gain in V/(rad/s). - */ - public void setKv(double kv) { - this.kv = kv; - } - /** * Returns the acceleration gain in V/(units/s²). * @@ -132,15 +141,6 @@ public class SimpleMotorFeedforward implements ProtobufSerializable, StructSeria return ka; } - /** - * Sets the acceleration gain. - * - * @param ka The acceleration gain in V/(rad/2²). - */ - public void setKa(double ka) { - this.ka = ka; - } - /** * Returns the period in seconds. * diff --git a/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h b/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h index aa524ef936..d6bdc0f81c 100644 --- a/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h @@ -244,6 +244,34 @@ class WPILIB_DLLEXPORT ArmFeedforward { return MaxAchievableAcceleration(-maxVoltage, angle, velocity); } + /** + * Sets the static gain. + * + * @param kS The static gain. + */ + constexpr void SetKs(units::volt_t kS) { this->kS = kS; } + + /** + * Sets the gravity gain. + * + * @param kG The gravity gain. + */ + constexpr void SetKg(units::volt_t kG) { this->kG = kG; } + + /** + * Sets the velocity gain. + * + * @param kV The velocity gain. + */ + constexpr void SetKv(units::unit_t kV) { this->kV = kV; } + + /** + * Sets the acceleration gain. + * + * @param kA The acceleration gain. + */ + constexpr void SetKa(units::unit_t kA) { this->kA = kA; } + /** * Returns the static gain. * @@ -251,13 +279,6 @@ class WPILIB_DLLEXPORT ArmFeedforward { */ constexpr units::volt_t GetKs() const { return kS; } - /** - * Returns the static gain. - * - * @param kS The static gain. - */ - constexpr void SetKs(units::volt_t kS) { this->kS = kS; } - /** * Returns the gravity gain. * @@ -265,13 +286,6 @@ class WPILIB_DLLEXPORT ArmFeedforward { */ constexpr units::volt_t GetKg() const { return kG; } - /** - * Returns the gravity gain. - * - * @param kG The gravity gain. - */ - constexpr void SetKg(units::volt_t kG) { this->kG = kG; } - /** * Returns the velocity gain. * @@ -279,13 +293,6 @@ class WPILIB_DLLEXPORT ArmFeedforward { */ constexpr units::unit_t GetKv() const { return kV; } - /** - * Returns the velocity gain. - * - * @param kV The velocity gain. - */ - constexpr void SetKv(units::unit_t kV) { this->kV = kV; } - /** * Returns the acceleration gain. * @@ -293,13 +300,6 @@ class WPILIB_DLLEXPORT ArmFeedforward { */ constexpr units::unit_t GetKa() const { return kA; } - /** - * Returns the acceleration gain. - * - * @param kA The acceleration gain. - */ - constexpr void SetKa(units::unit_t kA) { this->kA = kA; } - private: /// The static gain, in volts. units::volt_t kS; diff --git a/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h b/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h index 68565b0fac..93575276c5 100644 --- a/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h @@ -216,6 +216,34 @@ class ElevatorFeedforward { return MaxAchievableAcceleration(-maxVoltage, velocity); } + /** + * Sets the static gain. + * + * @param kS The static gain. + */ + constexpr void SetKs(units::volt_t kS) { this->kS = kS; } + + /** + * Sets the gravity gain. + * + * @param kG The gravity gain. + */ + constexpr void SetKg(units::volt_t kG) { this->kG = kG; } + + /** + * Sets the velocity gain. + * + * @param kV The velocity gain. + */ + constexpr void SetKv(units::unit_t kV) { this->kV = kV; } + + /** + * Sets the acceleration gain. + * + * @param kA The acceleration gain. + */ + constexpr void SetKa(units::unit_t kA) { this->kA = kA; } + /** * Returns the static gain. * @@ -223,13 +251,6 @@ class ElevatorFeedforward { */ constexpr units::volt_t GetKs() const { return kS; } - /** - * Returns the static gain. - * - * @param kS The static gain. - */ - constexpr void SetKs(units::volt_t kS) { this->kS = kS; } - /** * Returns the gravity gain. * @@ -237,13 +258,6 @@ class ElevatorFeedforward { */ constexpr units::volt_t GetKg() const { return kG; } - /** - * Returns the gravity gain. - * - * @param kG The gravity gain. - */ - constexpr void SetKg(units::volt_t kG) { this->kG = kG; } - /** * Returns the velocity gain. * @@ -251,13 +265,6 @@ class ElevatorFeedforward { */ constexpr units::unit_t GetKv() const { return kV; } - /** - * Returns the velocity gain. - * - * @param kV The velocity gain. - */ - constexpr void SetKv(units::unit_t kV) { this->kV = kV; } - /** * Returns the acceleration gain. * @@ -265,13 +272,6 @@ class ElevatorFeedforward { */ constexpr units::unit_t GetKa() const { return kA; } - /** - * Returns the acceleration gain. - * - * @param kA The acceleration gain. - */ - constexpr void SetKa(units::unit_t kA) { this->kA = kA; } - private: /// The static gain. units::volt_t kS; diff --git a/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h b/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h index 297bee8003..eb48be1c31 100644 --- a/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/SimpleMotorFeedforward.h @@ -194,6 +194,27 @@ class SimpleMotorFeedforward { return MaxAchievableAcceleration(-maxVoltage, velocity); } + /** + * Sets the static gain. + * + * @param kS The static gain. + */ + constexpr void SetKs(units::volt_t kS) { this->kS = kS; } + + /** + * Sets the velocity gain. + * + * @param kV The velocity gain. + */ + constexpr void SetKv(units::unit_t kV) { this->kV = kV; } + + /** + * Sets the acceleration gain. + * + * @param kA The acceleration gain. + */ + constexpr void SetKa(units::unit_t kA) { this->kA = kA; } + /** * Returns the static gain. * @@ -201,13 +222,6 @@ class SimpleMotorFeedforward { */ constexpr units::volt_t GetKs() const { return kS; } - /** - * Returns the static gain. - * - * @param kS The static gain. - */ - constexpr void SetKs(units::volt_t kS) { this->kS = kS; } - /** * Returns the velocity gain. * @@ -215,13 +229,6 @@ class SimpleMotorFeedforward { */ constexpr units::unit_t GetKv() const { return kV; } - /** - * Returns the velocity gain. - * - * @param kV The velocity gain. - */ - constexpr void SetKv(units::unit_t kV) { this->kV = kV; } - /** * Returns the acceleration gain. * @@ -229,13 +236,6 @@ class SimpleMotorFeedforward { */ constexpr units::unit_t GetKa() const { return kA; } - /** - * Returns the acceleration gain. - * - * @param kA The acceleration gain. - */ - constexpr void SetKa(units::unit_t kA) { this->kA = kA; } - /** * Returns the period. *