68 template <std::derived_from<Command> T>
71 this, std::forward<T>(defaultCommand));
A state machine representing a complete action to be performed by the robot.
Definition: Command.h:44
A wrapper around std::unique_ptr<Command> so commands have move-only semantics.
Definition: CommandPtr.h:29
static CommandScheduler & GetInstance()
Returns the Scheduler instance.
void SetDefaultCommand(Subsystem *subsystem, T &&defaultCommand)
Sets the default command for a subsystem.
Definition: CommandScheduler.h:173
A robot subsystem.
Definition: Subsystem.h:39
void SetDefaultCommand(CommandPtr &&defaultCommand)
Sets the default Command of the subsystem.
void SetDefaultCommand(T &&defaultCommand)
Sets the default Command of the subsystem.
Definition: Subsystem.h:69
Command * GetCurrentCommand() const
Returns the command currently running on this subsystem.
void Register()
Registers this subsystem with the CommandScheduler, allowing its Periodic() method to be called when ...
CommandPtr RunOnce(std::function< void()> action)
Constructs a command that runs an action once and finishes.
CommandPtr RunEnd(std::function< void()> run, std::function< void()> end)
Constructs a command that runs an action every iteration until interrupted, and then runs a second ac...
void RemoveDefaultCommand()
Removes the default command for the subsystem.
virtual void SimulationPeriodic()
This method is called periodically by the CommandScheduler.
virtual void Periodic()
This method is called periodically by the CommandScheduler.
CommandPtr StartEnd(std::function< void()> start, std::function< void()> end)
Constructs a command that runs an action once and another action when the command is interrupted.
Command * GetDefaultCommand() const
Gets the default command for this subsystem.
CommandPtr Run(std::function< void()> action)
Constructs a command that runs an action every iteration until interrupted.
static EIGEN_DEPRECATED const end_t end
Definition: IndexedViewHelper.h:181
Definition: ProfiledPIDCommand.h:18