8#include <initializer_list>
41 std::function<
void()> action,
42 std::initializer_list<Subsystem*> requirements);
51 std::span<Subsystem* const> requirements = {});
60 std::initializer_list<Subsystem*> requirements);
69 std::span<Subsystem* const> requirements = {});
80 std::function<
void()> start, std::function<
void()>
end,
81 std::initializer_list<Subsystem*> requirements);
92 std::function<
void()> start, std::function<
void()>
end,
93 std::span<Subsystem* const> requirements = {});
104 std::function<
void()>
end,
105 std::initializer_list<Subsystem*> requirements);
116 std::function<
void()>
end,
117 std::span<Subsystem* const> requirements = {});
153 std::function<
bool()> selector);
161template <
typename Key,
class... Types>
163 std::pair<Key, Types>&&... commands) {
164 std::vector<std::pair<Key, std::unique_ptr<Command>>> vec;
166 ((void)vec.emplace_back(commands.first, std::move(commands.second).Unwrap()),
179template <
typename... Args>
181 std::vector<CommandPtr>
data;
182 data.reserve(
sizeof...(Args));
183 (
data.emplace_back(std::forward<Args>(args)), ...);
197template <
typename... Args>
212template <
typename... Args>
227template <
typename... Args>
242template <
typename... Args>
252 std::vector<CommandPtr>&& others);
258template <
typename... Args>
260 return Deadline(std::move(deadline),
CommandPtr ToPtr() &&override
Definition: CommandHelper.h:32
A wrapper around std::unique_ptr<Command> so commands have move-only semantics.
Definition: CommandPtr.h:28
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:180
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 Select(std::function< Key()> selector, std::pair< Key, Types > &&... commands)
Runs one of several commands, based on the selector function.
Definition: Commands.h:162
CommandPtr RunOnce(std::function< void()> action, std::initializer_list< Subsystem * > requirements)
Constructs a command that runs an action once and finishes.
CommandPtr Race(std::vector< CommandPtr > &&commands)
Runs a group of commands at the same time.
Definition: InstantCommand.h:14
Definition: format.h:1544