8#include <initializer_list>
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,
59 std::span<Subsystem* const> requirements = {});
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,
89 std::span<Subsystem* const> requirements = {});
99 void End(
bool interrupted)
override;
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
A command that controls an output with a PIDController.
Definition: PIDCommand.h:27
PIDCommand(PIDController controller, std::function< double()> measurementSource, double setpoint, std::function< void(double)> useOutput, std::span< Subsystem *const > requirements={})
Creates a new PIDCommand, which controls the given output with a PIDController with a constant setpoi...
PIDCommand(PIDController controller, std::function< double()> measurementSource, std::function< double()> setpointSource, std::function< void(double)> useOutput, std::span< Subsystem *const > requirements={})
Creates a new PIDCommand, which controls the given output with a PIDController.
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.
PIDCommand(PIDCommand &&other)=default
std::function< double()> m_measurement
Definition: PIDCommand.h:110
void Initialize() override
The initial subroutine of a command.
std::function< void(double)> m_useOutput
Definition: PIDCommand.h:112
PIDCommand(PIDController controller, std::function< double()> measurementSource, double setpoint, std::function< void(double)> useOutput, std::initializer_list< Subsystem * > requirements)
Creates a new PIDCommand, which controls the given output with a PIDController with a constant setpoi...
void End(bool interrupted) override
The action to take when the command ends.
void Execute() override
The main body of a command.
PIDController & GetController()
Returns the PIDController used by the command.
PIDCommand(const PIDCommand &other)=default
PIDController m_controller
Definition: PIDCommand.h:109
std::function< double()> m_setpoint
Definition: PIDCommand.h:111
Implements a PID control loop.
Definition: PIDController.h:23
Definition: InstantCommand.h:14