87 virtual void UseOutput(
double output,
double setpoint) = 0;
Implements a PID control loop.
Definition: PIDController.h:23
A subsystem that uses a PIDController to control an output.
Definition: PIDSubsystem.h:20
bool IsEnabled()
Returns whether the controller is enabled.
PIDController m_controller
Definition: PIDSubsystem.h:71
virtual void Enable()
Enables the PID control.
virtual void UseOutput(double output, double setpoint)=0
Uses the output from the PIDController.
double GetSetpoint() const
Gets the setpoint for the subsystem.
PIDSubsystem(PIDController controller, double initialPosition=0)
Creates a new PIDSubsystem.
bool m_enabled
Definition: PIDSubsystem.h:72
virtual void Disable()
Disables the PID control.
void Periodic() override
This method is called periodically by the CommandScheduler.
virtual double GetMeasurement()=0
Returns the measurement of the process variable used by the PIDController.
PIDController & GetController()
Returns the PIDController.
void SetSetpoint(double setpoint)
Sets the setpoint for the subsystem.
A base for subsystems that handles registration in the constructor, and provides a more intuitive met...
Definition: SubsystemBase.h:24
Definition: ProfiledPIDCommand.h:18