13 #include "Commands/Subsystem.h"
14 #include "PIDController.h"
15 #include "PIDOutput.h"
16 #include "PIDSource.h"
32 PIDSubsystem(
const std::string& name,
double p,
double i,
double d);
33 PIDSubsystem(
const std::string& name,
double p,
double i,
double d,
double f);
34 PIDSubsystem(
const std::string& name,
double p,
double i,
double d,
double f,
38 PIDSubsystem(
double p,
double i,
double d,
double f,
double period);
45 virtual void PIDWrite(
double output);
48 virtual double PIDGet();
64 virtual double ReturnPIDInput() = 0;
65 virtual void UsePIDOutput(
double output) = 0;
69 std::shared_ptr<PIDController> m_controller;
72 void InitTable(std::shared_ptr<ITable> subtable)
override;
void SetSetpoint(double setpoint)
Sets the setpoint to the given value.
Definition: PIDSubsystem.cpp:146
virtual void SetPercentTolerance(double percent)
Set the percentage error which is considered tolerable for use with OnTarget.
Definition: PIDSubsystem.cpp:204
void SetOutputRange(double minimumOutput, double maximumOutput)
Sets the maximum and minimum values to write.
Definition: PIDSubsystem.cpp:185
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:19
virtual bool OnTarget() const
Return true if the error is within the percentage of the total input range, determined by SetToleranc...
Definition: PIDSubsystem.cpp:223
double GetSetpoint()
Return the current setpoint.
Definition: PIDSubsystem.cpp:167
std::shared_ptr< PIDController > GetPIDController()
Returns the PIDController used by this PIDSubsystem.
Definition: PIDSubsystem.cpp:134
This class is designed to handle the case where there is a Subsystem which uses a single PIDControlle...
Definition: PIDSubsystem.h:30
void InitTable(std::shared_ptr< ITable > subtable) override
Initializes a table for this sendable object.
Definition: PIDSubsystem.cpp:245
Definition: Subsystem.h:20
PIDSubsystem(const std::string &name, double p, double i, double d)
Instantiates a PIDSubsystem that will use the given p, i and d values.
Definition: PIDSubsystem.cpp:23
PIDOutput interface is a generic output for the PID class.
Definition: PIDOutput.h:20
void Enable()
Enables the internal PIDController.
Definition: PIDSubsystem.cpp:120
void SetInputRange(double minimumInput, double maximumInput)
Sets the maximum and minimum values expected from the input.
Definition: PIDSubsystem.cpp:175
void SetSetpointRelative(double deltaSetpoint)
Adds the given value to the setpoint.
Definition: PIDSubsystem.cpp:158
void Disable()
Disables the internal PIDController.
Definition: PIDSubsystem.cpp:125
double GetRate()
Returns the current rate.
Definition: PIDSubsystem.cpp:237
std::string GetSmartDashboardType() const override
Definition: PIDSubsystem.cpp:243
virtual void SetAbsoluteTolerance(double absValue)
Set the absolute error which is considered tolerable for use with OnTarget.
Definition: PIDSubsystem.cpp:195
double GetPosition()
Returns the current position.
Definition: PIDSubsystem.cpp:230