11 #include <initializer_list>
13 #include <frc/controller/PIDController.h>
15 #include "frc2/command/CommandBase.h"
16 #include "frc2/command/CommandHelper.h"
40 std::function<
double()> measurementSource,
41 std::function<
double()> setpointSource,
42 std::function<
void(
double)> useOutput,
43 std::initializer_list<Subsystem*> requirements);
56 std::function<
double()> measurementSource,
57 std::function<
double()> setpointSource,
58 std::function<
void(
double)> useOutput,
72 std::function<
double()> measurementSource,
double setpoint,
73 std::function<
void(
double)> useOutput,
74 std::initializer_list<Subsystem*> requirements);
87 std::function<
double()> measurementSource,
double setpoint,
88 std::function<
void(
double)> useOutput,
99 void End(
bool interrupted)
override;
110 std::function<double()> m_measurement;
111 std::function<double()> m_setpoint;
112 std::function<void(
double)> m_useOutput;
PIDCommand(PIDController controller, std::function< double()> measurementSource, std::function< double()> setpointSource, std::function< void(double)> useOutput, std::initializer_list< Subsystem * > requirements)
Creates a new PIDCommand, which controls the given output with a PIDController.
void Execute() override
The main body of a command.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:42
void Initialize() override
The initial subroutine of a command.
PIDController & GetController()
Returns the PIDController used by the command.
A command that controls an output with a PIDController.
Definition: PIDCommand.h:27
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
void End(bool interrupted) override
The action to take when the command ends.
Implements a PID control loop.
Definition: PIDController.h:23