mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[wpimath] Fix up order and docs for Feedforward gain setters (#7788)
This commit is contained in:
@@ -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_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Sets the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> 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<kv_unit> GetKv() const { return kV; }
|
||||
|
||||
/**
|
||||
* Returns the velocity gain.
|
||||
*
|
||||
* @param kV The velocity gain.
|
||||
*/
|
||||
constexpr void SetKv(units::unit_t<kv_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
@@ -293,13 +300,6 @@ class WPILIB_DLLEXPORT ArmFeedforward {
|
||||
*/
|
||||
constexpr units::unit_t<ka_unit> GetKa() const { return kA; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> kA) { this->kA = kA; }
|
||||
|
||||
private:
|
||||
/// The static gain, in volts.
|
||||
units::volt_t kS;
|
||||
|
||||
@@ -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_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Sets the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> 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<kv_unit> GetKv() const { return kV; }
|
||||
|
||||
/**
|
||||
* Returns the velocity gain.
|
||||
*
|
||||
* @param kV The velocity gain.
|
||||
*/
|
||||
constexpr void SetKv(units::unit_t<kv_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
@@ -265,13 +272,6 @@ class ElevatorFeedforward {
|
||||
*/
|
||||
constexpr units::unit_t<ka_unit> GetKa() const { return kA; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> kA) { this->kA = kA; }
|
||||
|
||||
private:
|
||||
/// The static gain.
|
||||
units::volt_t kS;
|
||||
|
||||
@@ -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_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Sets the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> 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<kv_unit> GetKv() const { return kV; }
|
||||
|
||||
/**
|
||||
* Returns the velocity gain.
|
||||
*
|
||||
* @param kV The velocity gain.
|
||||
*/
|
||||
constexpr void SetKv(units::unit_t<kv_unit> kV) { this->kV = kV; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
@@ -229,13 +236,6 @@ class SimpleMotorFeedforward {
|
||||
*/
|
||||
constexpr units::unit_t<ka_unit> GetKa() const { return kA; }
|
||||
|
||||
/**
|
||||
* Returns the acceleration gain.
|
||||
*
|
||||
* @param kA The acceleration gain.
|
||||
*/
|
||||
constexpr void SetKa(units::unit_t<ka_unit> kA) { this->kA = kA; }
|
||||
|
||||
/**
|
||||
* Returns the period.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user