29 double initialPosition = 0);
91 virtual void UseOutput(
double output,
double setpoint) = 0;
A subsystem that uses a PIDController to control an output.
Definition: PIDSubsystem.h:20
bool IsEnabled()
Returns whether the controller is enabled.
virtual void Enable()
Enables the PID control.
virtual void UseOutput(double output, double setpoint)=0
Uses the output from the PIDController.
frc::PIDController & GetController()
Returns the PIDController.
double GetSetpoint() const
Gets the setpoint for the subsystem.
PIDSubsystem(frc::PIDController controller, double initialPosition=0)
Creates a new PIDSubsystem.
bool m_enabled
Whether PID controller output is enabled.
Definition: PIDSubsystem.h:76
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.
void SetSetpoint(double setpoint)
Sets the setpoint for the subsystem.
frc::PIDController m_controller
PID controller.
Definition: PIDSubsystem.h:73
A base for subsystems that handles registration in the constructor, and provides a more intuitive met...
Definition: SubsystemBase.h:24
Implements a PID control loop.
Definition: PIDController.h:23
Definition: TrapezoidProfileSubsystem.h:12