mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[commands] Add StartRun command factory (#6572)
This commit is contained in:
@@ -159,6 +159,16 @@ class Subsystem {
|
||||
[[nodiscard]]
|
||||
CommandPtr RunEnd(std::function<void()> run, std::function<void()> end);
|
||||
|
||||
/**
|
||||
* Constructs a command that runs an action once, and then runs an action
|
||||
* every iteration until interrupted. Requires this subsystem.
|
||||
*
|
||||
* @param start the action to run on start
|
||||
* @param run the action to run every iteration
|
||||
*/
|
||||
[[nodiscard]]
|
||||
CommandPtr StartRun(std::function<void()> start, std::function<void()> run);
|
||||
|
||||
/**
|
||||
* Constructs a DeferredCommand with the provided supplier. This subsystem is
|
||||
* added as a requirement.
|
||||
|
||||
Reference in New Issue
Block a user