10 #include <frc/controller/PIDController.h>
12 #include "frc2/command/SubsystemBase.h"
66 bool m_enabled{
false};
81 virtual void UseOutput(
double output,
double setpoint) = 0;
PIDSubsystem(PIDController controller, double initialPosition=0)
Creates a new PIDSubsystem.
A subsystem that uses a PIDController to control an output.
Definition: PIDSubsystem.h:21
virtual void Disable()
Disables the PID control.
bool IsEnabled()
Returns whether the controller is enabled.
void SetSetpoint(double setpoint)
Sets the setpoint for the subsystem.
virtual double GetMeasurement()=0
Returns the measurement of the process variable used by the PIDController.
PIDController & GetController()
Returns the PIDController.
virtual void UseOutput(double output, double setpoint)=0
Uses the output from the PIDController.
Implements a PID control loop.
Definition: PIDController.h:23
void Periodic() override
This method is called periodically by the CommandScheduler.
virtual void Enable()
Enables the PID control.
A base for subsystems that handles registration in the constructor, and provides a more intuitive met...
Definition: SubsystemBase.h:22