Package me.nabdev.oxconfig.sampleClasses
Class ConfigurableProfiledPIDController
java.lang.Object
edu.wpi.first.math.controller.ProfiledPIDController
me.nabdev.oxconfig.sampleClasses.ConfigurableProfiledPIDController
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,ConfigurableClass
public class ConfigurableProfiledPIDController
extends edu.wpi.first.math.controller.ProfiledPIDController
implements ConfigurableClass
A WPILib ProfiledPIDController that can be configured by OxConfig.
This class is an example of implementing ConfigurableClass, but is safe for
competition use.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurableProfiledPIDController
(double Kp, double Ki, double Kd, edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints constraints, String key) Allocates a ConfigurableProfiledPIDController and registers it to OxConfig with the given constants for kp, ki, and kd and a default period of 0.02 seconds.ConfigurableProfiledPIDController
(double Kp, double Ki, double Kd, edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints constraints, String key, String prettyName) Allocates a ConfigurableProfiledPIDController and registers it to OxConfig with the given constants for kp, ki, and kd and a default period of 0.02 seconds. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Gets the key of the configurable class (e.g.Gets the parameters of the configurable classGets the pretty name of the configurable class (e.g.Methods inherited from class edu.wpi.first.math.controller.ProfiledPIDController
atGoal, atSetpoint, calculate, calculate, calculate, calculate, disableContinuousInput, enableContinuousInput, getAccumulatedError, getConstraints, getD, getGoal, getI, getIZone, getP, getPeriod, getPositionError, getPositionTolerance, getSetpoint, getVelocityError, getVelocityTolerance, initSendable, reset, reset, reset, setConstraints, setD, setGoal, setGoal, setI, setIntegratorRange, setIZone, setP, setPID, setTolerance, setTolerance
-
Constructor Details
-
ConfigurableProfiledPIDController
public ConfigurableProfiledPIDController(double Kp, double Ki, double Kd, edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints constraints, String key) Allocates a ConfigurableProfiledPIDController and registers it to OxConfig with the given constants for kp, ki, and kd and a default period of 0.02 seconds. Unfortunatley, OxConfig is unable to configure the constraints, as they cannot be changed.- Parameters:
Kp
- The proportional coefficient.Ki
- The integral coefficient.Kd
- The derivative coefficient.constraints
- Velocity and acceleration constraints for goal.key
- The json key for the controller to be stored in
-
ConfigurableProfiledPIDController
public ConfigurableProfiledPIDController(double Kp, double Ki, double Kd, edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints constraints, String key, String prettyName) Allocates a ConfigurableProfiledPIDController and registers it to OxConfig with the given constants for kp, ki, and kd and a default period of 0.02 seconds. Unfortunatley, OxConfig is unable to configure the constraints, as they cannot be changed.- Parameters:
Kp
- The proportional coefficient.Ki
- The integral coefficient.Kd
- The derivative coefficient.constraints
- Velocity and acceleration constraints for goal.key
- The json key for the controller to be stored inprettyName
- The name to be displayed in the OxConfig GUI
-
-
Method Details
-
getParameters
Description copied from interface:ConfigurableClass
Gets the parameters of the configurable class- Specified by:
getParameters
in interfaceConfigurableClass
- Returns:
- The parameters of the configurable class
-
getKey
Description copied from interface:ConfigurableClass
Gets the key of the configurable class (e.g. "Arm"), must not include commas- Specified by:
getKey
in interfaceConfigurableClass
- Returns:
- The key of the configurable class
-
getPrettyName
Description copied from interface:ConfigurableClass
Gets the pretty name of the configurable class (e.g. "Arm")- Specified by:
getPrettyName
in interfaceConfigurableClass
- Returns:
- The pretty name of the configurable class
-