WPILibC++ 2023.4.3
|
Namespace for command factories. More...
Namespaces | |
namespace | impl |
Functions | |
CommandPtr | None () |
Constructs a command that does nothing, finishing immediately. More... | |
CommandPtr | RunOnce (std::function< void()> action, std::initializer_list< Subsystem * > requirements) |
Constructs a command that runs an action once and finishes. More... | |
CommandPtr | RunOnce (std::function< void()> action, std::span< Subsystem *const > requirements={}) |
Constructs a command that runs an action once and finishes. More... | |
CommandPtr | Run (std::function< void()> action, std::initializer_list< Subsystem * > requirements) |
Constructs a command that runs an action every iteration until interrupted. More... | |
CommandPtr | Run (std::function< void()> action, std::span< Subsystem *const > requirements={}) |
Constructs a command that runs an action every iteration until interrupted. More... | |
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. More... | |
CommandPtr | StartEnd (std::function< void()> start, std::function< void()> end, std::span< Subsystem *const > requirements={}) |
Constructs a command that runs an action once and another action when the command is interrupted. More... | |
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 action. More... | |
CommandPtr | RunEnd (std::function< void()> run, std::function< void()> end, std::span< Subsystem *const > requirements={}) |
Constructs a command that runs an action every iteration until interrupted, and then runs a second action. More... | |
CommandPtr | Print (std::string_view msg) |
Constructs a command that prints a message and finishes. More... | |
CommandPtr | Wait (units::second_t duration) |
Constructs a command that does nothing, finishing after a specified duration. More... | |
CommandPtr | WaitUntil (std::function< bool()> condition) |
Constructs a command that does nothing, finishing once a condition becomes true. More... | |
CommandPtr | Either (CommandPtr &&onTrue, CommandPtr &&onFalse, std::function< bool()> selector) |
Runs one of two commands, based on the boolean selector function. More... | |
template<typename Key , class... Types> | |
CommandPtr | Select (std::function< Key()> selector, std::pair< Key, Types > &&... commands) |
Runs one of several commands, based on the selector function. More... | |
CommandPtr | Sequence (std::vector< CommandPtr > &&commands) |
Runs a group of commands in series, one after the other. More... | |
template<typename... Args> | |
CommandPtr | Sequence (Args &&... commands) |
Runs a group of commands in series, one after the other. More... | |
CommandPtr | RepeatingSequence (std::vector< CommandPtr > &&commands) |
Runs a group of commands in series, one after the other. More... | |
template<typename... Args> | |
CommandPtr | RepeatingSequence (Args &&... commands) |
Runs a group of commands in series, one after the other. More... | |
CommandPtr | Parallel (std::vector< CommandPtr > &&commands) |
Runs a group of commands at the same time. More... | |
template<typename... Args> | |
CommandPtr | Parallel (Args &&... commands) |
Runs a group of commands at the same time. More... | |
CommandPtr | Race (std::vector< CommandPtr > &&commands) |
Runs a group of commands at the same time. More... | |
template<typename... Args> | |
CommandPtr | Race (Args &&... commands) |
Runs a group of commands at the same time. More... | |
CommandPtr | Deadline (CommandPtr &&deadline, std::vector< CommandPtr > &&others) |
Runs a group of commands at the same time. More... | |
template<typename... Args> | |
CommandPtr | Deadline (CommandPtr &&deadline, Args &&... commands) |
Runs a group of commands at the same time. More... | |
Namespace for command factories.
CommandPtr frc2::cmd::Deadline | ( | CommandPtr && | deadline, |
Args &&... | commands | ||
) |
Runs a group of commands at the same time.
Ends once a specific command finishes, and cancels the others.
CommandPtr frc2::cmd::Deadline | ( | CommandPtr && | deadline, |
std::vector< CommandPtr > && | others | ||
) |
Runs a group of commands at the same time.
Ends once a specific command finishes, and cancels the others.
CommandPtr frc2::cmd::Either | ( | CommandPtr && | onTrue, |
CommandPtr && | onFalse, | ||
std::function< bool()> | selector | ||
) |
Runs one of two commands, based on the boolean selector function.
onTrue | the command to run if the selector function returns true |
onFalse | the command to run if the selector function returns false |
selector | the selector function |
CommandPtr frc2::cmd::None | ( | ) |
Constructs a command that does nothing, finishing immediately.
CommandPtr frc2::cmd::Parallel | ( | Args &&... | commands | ) |
Runs a group of commands at the same time.
Ends once all commands in the group finish.
CommandPtr frc2::cmd::Parallel | ( | std::vector< CommandPtr > && | commands | ) |
Runs a group of commands at the same time.
Ends once all commands in the group finish.
CommandPtr frc2::cmd::Print | ( | std::string_view | msg | ) |
Constructs a command that prints a message and finishes.
msg | the message to print |
CommandPtr frc2::cmd::Race | ( | Args &&... | commands | ) |
Runs a group of commands at the same time.
Ends once any command in the group finishes, and cancels the others.
CommandPtr frc2::cmd::Race | ( | std::vector< CommandPtr > && | commands | ) |
Runs a group of commands at the same time.
Ends once any command in the group finishes, and cancels the others.
CommandPtr frc2::cmd::RepeatingSequence | ( | Args &&... | commands | ) |
Runs a group of commands in series, one after the other.
Once the last command ends, the group is restarted.
CommandPtr frc2::cmd::RepeatingSequence | ( | std::vector< CommandPtr > && | commands | ) |
Runs a group of commands in series, one after the other.
Once the last command ends, the group is restarted.
CommandPtr frc2::cmd::Run | ( | std::function< void()> | action, |
std::initializer_list< Subsystem * > | requirements | ||
) |
Constructs a command that runs an action every iteration until interrupted.
action | the action to run |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::Run | ( | std::function< void()> | action, |
std::span< Subsystem *const > | requirements = {} |
||
) |
Constructs a command that runs an action every iteration until interrupted.
action | the action to run |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::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 action.
run | the action to run every iteration |
end | the action to run on interrupt |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::RunEnd | ( | std::function< void()> | run, |
std::function< void()> | end, | ||
std::span< Subsystem *const > | requirements = {} |
||
) |
Constructs a command that runs an action every iteration until interrupted, and then runs a second action.
run | the action to run every iteration |
end | the action to run on interrupt |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::RunOnce | ( | std::function< void()> | action, |
std::initializer_list< Subsystem * > | requirements | ||
) |
Constructs a command that runs an action once and finishes.
action | the action to run |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::RunOnce | ( | std::function< void()> | action, |
std::span< Subsystem *const > | requirements = {} |
||
) |
Constructs a command that runs an action once and finishes.
action | the action to run |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::Select | ( | std::function< Key()> | selector, |
std::pair< Key, Types > &&... | commands | ||
) |
Runs one of several commands, based on the selector function.
selector | the selector function |
commands | map of commands to select from |
CommandPtr frc2::cmd::Sequence | ( | Args &&... | commands | ) |
Runs a group of commands in series, one after the other.
CommandPtr frc2::cmd::Sequence | ( | std::vector< CommandPtr > && | commands | ) |
Runs a group of commands in series, one after the other.
CommandPtr frc2::cmd::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.
start | the action to run on start |
end | the action to run on interrupt |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::StartEnd | ( | std::function< void()> | start, |
std::function< void()> | end, | ||
std::span< Subsystem *const > | requirements = {} |
||
) |
Constructs a command that runs an action once and another action when the command is interrupted.
start | the action to run on start |
end | the action to run on interrupt |
requirements | subsystems the action requires |
CommandPtr frc2::cmd::Wait | ( | units::second_t | duration | ) |
Constructs a command that does nothing, finishing after a specified duration.
duration | after how long the command finishes |
CommandPtr frc2::cmd::WaitUntil | ( | std::function< bool()> | condition | ) |
Constructs a command that does nothing, finishing once a condition becomes true.
condition | the condition |