10 #include <type_traits>
13 #include "frc2/command/CommandScheduler.h"
60 template <
class T,
typename = std::enable_if_t<std::is_base_of_v<
61 Command, std::remove_reference_t<T>>>>
64 this, std::forward<T>(defaultCommand));
virtual void Periodic()
This method is called periodically by the CommandScheduler.
static CommandScheduler & GetInstance()
Returns the Scheduler instance.
A state machine representing a complete action to be performed by the robot.
Definition: Command.h:52
void Register()
Registers this subsystem with the CommandScheduler, allowing its Periodic() method to be called when ...
Command * GetDefaultCommand() const
Gets the default command for this subsystem.
Command * GetCurrentCommand() const
Returns the command currently running on this subsystem.
A robot subsystem.
Definition: Subsystem.h:39
void SetDefaultCommand(T &&defaultCommand)
Sets the default Command of the subsystem.
Definition: Subsystem.h:62
void SetDefaultCommand(Subsystem *subsystem, T &&defaultCommand)
Sets the default command for a subsystem.
Definition: CommandScheduler.h:178