9#include <initializer_list>
44 std::initializer_list<Subsystem*> requirements);
54 std::span<Subsystem* const> requirements = {});
64 std::initializer_list<Subsystem*> requirements);
74 std::span<Subsystem* const> requirements = {});
86 std::initializer_list<Subsystem*> requirements);
98 std::span<Subsystem* const> requirements = {});
110 std::initializer_list<Subsystem*> requirements);
122 std::span<Subsystem* const> requirements = {});
162 std::function<
bool()> selector);
170template <
typename Key, std::convertible_to<CommandPtr>... CommandPtrs>
173 std::pair<Key, CommandPtrs>&&... commands) {
174 std::vector<std::pair<Key, std::unique_ptr<Command>>> vec;
176 ((void)vec.emplace_back(commands.first, std::move(commands.second).Unwrap()),
189template <std::convertible_to<CommandPtr>... Args>
191 std::vector<CommandPtr>
data;
192 data.reserve(
sizeof...(Args));
193 (
data.emplace_back(std::forward<Args>(args)), ...);
208template <std::convertible_to<CommandPtr>... CommandPtrs>
225template <std::convertible_to<CommandPtr>... CommandPtrs>
243template <std::convertible_to<CommandPtr>... CommandPtrs>
260template <std::convertible_to<CommandPtr>... CommandPtrs>
277template <std::convertible_to<CommandPtr>... CommandPtrs>
280 return Deadline(std::move(deadline),
CommandPtr ToPtr() &&override
Definition: CommandHelper.h:31
A wrapper around std::unique_ptr<Command> so commands have move-only semantics.
Definition: CommandPtr.h:29
A command composition that runs one of a selection of commands, either using a selector and a key to ...
Definition: SelectCommand.h:38
basic_string_view< char > string_view
Definition: core.h:520
static EIGEN_DEPRECATED const end_t end
Definition: IndexedViewHelper.h:181
std::vector< CommandPtr > MakeVector(Args &&... args)
Create a vector of commands.
Definition: Commands.h:190
CommandPtr Run(std::function< void()> action, std::initializer_list< Subsystem * > requirements)
Constructs a command that runs an action every iteration until interrupted.
CommandPtr Deadline(CommandPtr &&deadline, std::vector< CommandPtr > &&others)
Runs a group of commands at the same time.
CommandPtr WaitUntil(std::function< bool()> condition)
Constructs a command that does nothing, finishing once a condition becomes true.
CommandPtr StartEnd(std::function< void()> start, std::function< void()> end, std::initializer_list< Subsystem * > requirements)
Constructs a command that runs an action once and another action when the command is interrupted.
CommandPtr Either(CommandPtr &&onTrue, CommandPtr &&onFalse, std::function< bool()> selector)
Runs one of two commands, based on the boolean selector function.
CommandPtr None()
Constructs a command that does nothing, finishing immediately.
CommandPtr Parallel(std::vector< CommandPtr > &&commands)
Runs a group of commands at the same time.
CommandPtr RepeatingSequence(std::vector< CommandPtr > &&commands)
Runs a group of commands in series, one after the other.
CommandPtr Sequence(std::vector< CommandPtr > &&commands)
Runs a group of commands in series, one after the other.
CommandPtr RunEnd(std::function< void()> run, std::function< void()> end, std::initializer_list< Subsystem * > requirements)
Constructs a command that runs an action every iteration until interrupted, and then runs a second ac...
CommandPtr Print(std::string_view msg)
Constructs a command that prints a message and finishes.
CommandPtr Wait(units::second_t duration)
Constructs a command that does nothing, finishing after a specified duration.
CommandPtr RunOnce(std::function< void()> action, std::initializer_list< Subsystem * > requirements)
Constructs a command that runs an action once and finishes.
CommandPtr Select(std::function< Key()> selector, std::pair< Key, CommandPtrs > &&... commands)
Runs one of several commands, based on the selector function.
Definition: Commands.h:172
CommandPtr Race(std::vector< CommandPtr > &&commands)
Runs a group of commands at the same time.
Definition: ProfiledPIDCommand.h:18
Definition: format.h:1552