WPILibC++ 2025.2.1
|
Namespace for command factories. More...
Namespaces | |
namespace | impl |
Functions | |
CommandPtr | None () |
Constructs a command that does nothing, finishing immediately. | |
CommandPtr | Idle (Requirements requirements={}) |
Constructs a command that does nothing until interrupted. | |
CommandPtr | RunOnce (std::function< void()> action, Requirements requirements={}) |
Constructs a command that runs an action once and finishes. | |
CommandPtr | Run (std::function< void()> action, Requirements requirements={}) |
Constructs a command that runs an action every iteration until interrupted. | |
CommandPtr | StartEnd (std::function< void()> start, std::function< void()> end, Requirements requirements={}) |
Constructs a command that runs an action once and another action when the command is interrupted. | |
CommandPtr | RunEnd (std::function< void()> run, std::function< void()> end, Requirements requirements={}) |
Constructs a command that runs an action every iteration until interrupted, and then runs a second action. | |
CommandPtr | StartRun (std::function< void()> start, std::function< void()> run, Requirements requirements={}) |
Constructs a command that runs an action once, and then runs an action every iteration until interrupted. | |
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 | WaitUntil (std::function< bool()> condition) |
Constructs a command that does nothing, finishing once a condition becomes true. | |
CommandPtr | Either (CommandPtr &&onTrue, CommandPtr &&onFalse, std::function< bool()> selector) |
Runs one of two commands, based on the boolean selector function. | |
template<typename Key , std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | Select (std::function< Key()> selector, std::pair< Key, CommandPtrs > &&... commands) |
Runs one of several commands, based on the selector function. | |
CommandPtr | Defer (wpi::unique_function< CommandPtr()> supplier, Requirements requirements) |
Runs the command supplied by the supplier. | |
CommandPtr | DeferredProxy (wpi::unique_function< Command *()> supplier) |
Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled. | |
CommandPtr | DeferredProxy (wpi::unique_function< CommandPtr()> supplier) |
Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled. | |
CommandPtr | Sequence (std::vector< CommandPtr > &&commands) |
Runs a group of commands in series, one after the other. | |
template<std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | Sequence (CommandPtrs &&... commands) |
Runs a group of commands in series, one after the other. | |
CommandPtr | RepeatingSequence (std::vector< CommandPtr > &&commands) |
Runs a group of commands in series, one after the other. | |
template<std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | RepeatingSequence (CommandPtrs &&... commands) |
Runs a group of commands in series, one after the other. | |
CommandPtr | Parallel (std::vector< CommandPtr > &&commands) |
Runs a group of commands at the same time. | |
template<std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | Parallel (CommandPtrs &&... commands) |
Runs a group of commands at the same time. | |
CommandPtr | Race (std::vector< CommandPtr > &&commands) |
Runs a group of commands at the same time. | |
template<std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | Race (CommandPtrs &&... commands) |
Runs a group of commands at the same time. | |
CommandPtr | Deadline (CommandPtr &&deadline, std::vector< CommandPtr > &&others) |
Runs a group of commands at the same time. | |
template<std::convertible_to< CommandPtr >... CommandPtrs> | |
CommandPtr | Deadline (CommandPtr &&deadline, CommandPtrs &&... commands) |
Runs a group of commands at the same time. | |
Namespace for command factories.
|
nodiscard |
Runs a group of commands at the same time.
Ends once a specific command finishes, and cancels the others.
|
nodiscard |
Runs a group of commands at the same time.
Ends once a specific command finishes, and cancels the others.
|
nodiscard |
Runs the command supplied by the supplier.
supplier | the command supplier |
requirements | the set of requirements for this command |
|
nodiscard |
Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled.
The supplier is called when the command is initialized.
supplier | the command supplier |
|
nodiscard |
Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled.
The supplier is called when the command is initialized.
supplier | the command supplier |
|
nodiscard |
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 |
|
nodiscard |
Constructs a command that does nothing until interrupted.
requirements | Subsystems to require |
|
nodiscard |
Constructs a command that does nothing, finishing immediately.
|
nodiscard |
Runs a group of commands at the same time.
Ends once all commands in the group finish.
|
nodiscard |
Runs a group of commands at the same time.
Ends once all commands in the group finish.
|
nodiscard |
Constructs a command that prints a message and finishes.
msg | the message to print |
|
nodiscard |
Runs a group of commands at the same time.
Ends once any command in the group finishes, and cancels the others.
|
nodiscard |
Runs a group of commands at the same time.
Ends once any command in the group finishes, and cancels the others.
|
nodiscard |
Runs a group of commands in series, one after the other.
Once the last command ends, the group is restarted.
|
nodiscard |
Runs a group of commands in series, one after the other.
Once the last command ends, the group is restarted.
|
nodiscard |
Constructs a command that runs an action every iteration until interrupted.
action | the action to run |
requirements | subsystems the action requires |
|
nodiscard |
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 |
|
nodiscard |
Constructs a command that runs an action once and finishes.
action | the action to run |
requirements | subsystems the action requires |
|
nodiscard |
Runs one of several commands, based on the selector function.
selector | the selector function |
commands | map of commands to select from |
|
nodiscard |
Runs a group of commands in series, one after the other.
|
nodiscard |
Runs a group of commands in series, one after the other.
|
nodiscard |
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 |
|
nodiscard |
Constructs a command that runs an action once, and then runs an action every iteration until interrupted.
start | the action to run on start |
run | the action to run every iteration |
requirements | subsystems the action requires |
|
nodiscard |
Constructs a command that does nothing, finishing after a specified duration.
duration | after how long the command finishes |
|
nodiscard |
Constructs a command that does nothing, finishing once a condition becomes true.
condition | the condition |