Class PIDConfiguration
- java.lang.Object
-
- frc.team88.swerve.configuration.subconfig.PIDConfiguration
-
- All Implemented Interfaces:
NetworkTablePopulator
public class PIDConfiguration extends java.lang.Object implements NetworkTablePopulator
Contains PID values pulled from a config file.
-
-
Constructor Summary
Constructors Constructor Description PIDConfiguration(com.electronwill.nightconfig.core.Config config)
Constructs from a raw configuration containing some of the appropriate fields.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getIMax()
Gets the iMax value.double
getIZone()
Gets the iZone value.double
getKD()
Gets the kD value.double
getKF()
Gets the kF value.double
getKI()
Gets the kI value.double
getKP()
Gets the kP value.double
getTolerance()
Gets the tolerance value.void
populateNetworkTable(edu.wpi.first.networktables.NetworkTable table)
Populates the given network table with data from this class.
-
-
-
Constructor Detail
-
PIDConfiguration
public PIDConfiguration(com.electronwill.nightconfig.core.Config config)
Constructs from a raw configuration containing some of the appropriate fields.- Parameters:
config
- The raw configuration.- Throws:
SwerveConfigException
- If the user provided config is incorrect.
-
-
Method Detail
-
getKP
public double getKP()
Gets the kP value.- Returns:
- The proportional constant.
-
getKI
public double getKI()
Gets the kI value.- Returns:
- The integral constant.
-
getKD
public double getKD()
Gets the kD value.- Returns:
- The differential constant.
-
getKF
public double getKF()
Gets the kF value.- Returns:
- The feedforward constant.
-
getIZone
public double getIZone()
Gets the iZone value.- Returns:
- The max error for which integral will be accumulated.
-
getIMax
public double getIMax()
Gets the iMax value.- Returns:
- The max accumulated integral value.
-
getTolerance
public double getTolerance()
Gets the tolerance value.- Returns:
- The minimum error for the PID output to be non-zero.
-
populateNetworkTable
public void populateNetworkTable(edu.wpi.first.networktables.NetworkTable table)
Description copied from interface:NetworkTablePopulator
Populates the given network table with data from this class. May also read in values.- Specified by:
populateNetworkTable
in interfaceNetworkTablePopulator
- Parameters:
table
- The table to populate, and possibly read from.
-
-