Package frc.robot.shared.config
Class FeedforwardConfig
java.lang.Object
frc.robot.shared.config.AbstractConfig
frc.robot.shared.config.FeedforwardConfig
Configuration bundle for feedforward gains used by motor control subsystems.
Holds the gains that the subsystem consumes directly (kS, kV, kA, kG). Since SysIdHelper pre-multiplies
position and velocity by 2pi before logging, the SysId analysis tool reports gains in per-radian units that can be entered here directly without
correction.
-
Nested Class Summary
Nested classes/interfaces inherited from class frc.robot.shared.config.AbstractConfig
AbstractConfig.ComponentPoseConfig -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetkA()Returns the acceleration feedforward gain, tuned via SmartDashboard.doublegetkG()Returns the gravity feedforward gain, tuned via SmartDashboard.doublegetkS()Returns the static feedforward gain, tuned via SmartDashboard.doublegetkV()Returns the velocity feedforward gain, tuned via SmartDashboard.Methods inherited from class frc.robot.shared.config.AbstractConfig
getDashboardPrefix, initializeNestedDashboardPrefixes, readTunableBoolean, readTunableDegrees, readTunableDegreesAsRadians, readTunableNumber, readTunableString, setDashboardPrefix
-
Field Details
-
kS
public double kSStatic feedforward gain in volts. -
kV
public double kVVelocity feedforward gain in volts per radian per second. -
kA
public double kAAcceleration feedforward gain in volts per radian per second squared. -
kG
public double kGGravity feedforward gain in volts.This is the voltage needed to hold an arm-type mechanism stationary against gravity when horizontal. Set to 0 for non-arm mechanisms (flywheels, belts, turrets). WPILib's
ArmFeedforwardmultiplies kG by the cosine of the angle from horizontal.
-
-
Constructor Details
-
FeedforwardConfig
public FeedforwardConfig()
-
-
Method Details
-
getkS
public double getkS()Returns the static feedforward gain, tuned via SmartDashboard.- Returns:
- kS in volts
-
getkV
public double getkV()Returns the velocity feedforward gain, tuned via SmartDashboard.- Returns:
- kV in volts per radian per second
-
getkA
public double getkA()Returns the acceleration feedforward gain, tuned via SmartDashboard.- Returns:
- kA in volts per radian per second squared
-
getkG
public double getkG()Returns the gravity feedforward gain, tuned via SmartDashboard.- Returns:
- kG in volts (voltage to hold the mechanism horizontal against gravity)
-