33 template <std::derived_from<Command> T>
192 [[deprecated(
"Replace with DeadlineFor")]]
284 void Schedule() const&;
287 void Schedule() && = delete;
293 void Cancel() const&;
296 void Cancel() && = delete;
305 bool IsScheduled() const&;
308 void IsScheduled() && = delete;
321 void HasRequirement(
Subsystem* requirement) && = delete;
326 explicit operator
bool() const&;
329 explicit operator
bool() && = delete;
339 std::
string m_moveOutSite{
""};
340 void AssertValid()
const;
A state machine representing a complete action to be performed by the robot.
Definition Command.h:41
InterruptionBehavior
An enum describing the command's behavior when another command with a shared requirement is scheduled...
Definition Command.h:173
A wrapper around std::unique_ptr<Command> so commands have move-only semantics.
Definition CommandPtr.h:29
CommandPtr OnlyIf(std::function< bool()> condition) &&
Decorates this command to only run if this condition is met.
CommandPtr HandleInterrupt(std::function< void()> handler) &&
Decorates this command with a lambda to call on interrupt, following the command's inherent Command::...
CommandPtr Unless(std::function< bool()> condition) &&
Decorates this command to only run if this condition is not met.
CommandPtr WithDeadline(CommandPtr &&deadline) &&
Creates a new command that runs this command and the deadline in parallel, finishing (and interruptin...
CommandPtr FinallyDo(std::function< void()> end) &&
Decorates this command with a lambda to call on interrupt or end, following the command's inherent Co...
CommandPtr BeforeStarting(std::function< void()> toRun, Requirements requirements={}) &&
Decorates this command with a runnable to run before this command starts.
Command * get() const &
Get a raw pointer to the held command.
CommandPtr RaceWith(CommandPtr &¶llel) &&
Decorates this command with a set of commands to run parallel to it, ending when the first command en...
CommandPtr AndThen(CommandPtr &&next) &&
Decorates this command with a set of commands to run after it in sequence.
CommandPtr Until(std::function< bool()> condition) &&
Decorates this command with an interrupt condition.
CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&
Decorates this command to run or stop when disabled.
CommandPtr WithInterruptBehavior(Command::InterruptionBehavior interruptBehavior) &&
Decorates this command to have a different interrupt behavior.
CommandPtr BeforeStarting(CommandPtr &&before) &&
Decorates this command with another command to run before this command starts.
CommandPtr WithName(std::string_view name) &&
Decorates this Command with a name.
CommandPtr AlongWith(CommandPtr &¶llel) &&
Decorates this command with a set of commands to run parallel to it, ending when the last command end...
CommandPtr(std::unique_ptr< Command > &&command)
CommandPtr(CommandPtr &&)
CommandPtr(T &&command)
Definition CommandPtr.h:35
CommandPtr(std::nullptr_t)=delete
CommandPtr AsProxy() &&
Decorates this command to run "by proxy" by wrapping it in a ProxyCommand.
CommandPtr OnlyWhile(std::function< bool()> condition) &&
Decorates this command with a run condition.
CommandPtr FinallyDo(std::function< void(bool)> end) &&
Decorates this command with a lambda to call on interrupt or end, following the command's inherent Co...
CommandPtr WithTimeout(units::second_t duration) &&
Decorates this command with a timeout.
CommandPtr Repeatedly() &&
Decorates this command to run repeatedly, restarting it when it ends, until this command is interrupt...
CommandPtr & operator=(CommandPtr &&)=default
CommandPtr AndThen(std::function< void()> toRun, Requirements requirements={}) &&
Decorates this command with a runnable to run after the command finishes.
CommandPtr DeadlineFor(CommandPtr &¶llel) &&
Decorates this command with a set of commands to run parallel to it, ending when the calling command ...
CommandPtr DeadlineWith(CommandPtr &¶llel) &&
Decorates this command with a set of commands to run parallel to it, ending when the calling command ...
The scheduler responsible for running Commands.
Definition CommandScheduler.h:38
Represents requirements for a command, which is a set of (pointers to) subsystems.
Definition Requirements.h:20
A robot subsystem.
Definition Subsystem.h:43
Definition FunctionalCommand.h:13
Definition PointerIntPair.h:280
typename std::decay< T >::type decay_t
Definition base.h:326