12 #include <wpi/Twine.h>
14 #include "frc/PIDController.h"
15 #include "frc/PIDOutput.h"
16 #include "frc/PIDSource.h"
17 #include "frc/commands/Subsystem.h"
104 PIDSubsystem(
double p,
double i,
double d,
double f,
double period);
122 void PIDWrite(
double output)
override;
126 double PIDGet()
override;
154 void SetInputRange(
double minimumInput,
double maximumInput);
228 virtual double ReturnPIDInput() = 0;
229 virtual void UsePIDOutput(
double output) = 0;
233 std::shared_ptr<PIDController> m_controller;
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:20
virtual bool OnTarget() const
Return true if the error is within the percentage of the total input range, determined by SetToleranc...
void Enable()
Enables the internal PIDController.
This class is designed to handle the case where there is a Subsystem which uses a single PIDControlle...
Definition: PIDSubsystem.h:30
void SetSetpoint(double setpoint)
Sets the setpoint to the given value.
virtual void SetPercentTolerance(double percent)
Set the percentage error which is considered tolerable for use with OnTarget().
void Disable()
Disables the internal PIDController.
void SetSetpointRelative(double deltaSetpoint)
Adds the given value to the setpoint.
void SetOutputRange(double minimumOutput, double maximumOutput)
Sets the maximum and minimum values to write.
double GetRate()
Returns the current rate.
void SetInputRange(double minimumInput, double maximumInput)
Sets the maximum and minimum values expected from the input.
Definition: Subsystem.h:24
double GetPosition()
Returns the current position.
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
virtual void SetAbsoluteTolerance(double absValue)
Set the absolute error which is considered tolerable for use with OnTarget.
PIDOutput interface is a generic output for the PID class.
Definition: PIDOutput.h:20
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:85
std::shared_ptr< PIDController > GetPIDController()
Returns the PIDController used by this PIDSubsystem.
double GetSetpoint()
Return the current setpoint.
PIDSubsystem(const wpi::Twine &name, double p, double i, double d)
Instantiates a PIDSubsystem that will use the given P, I, and D values.