A command that runs a Runnable continuously.
More...
#include <frc2/command/RunCommand.h>
A command that runs a Runnable continuously.
Has no end condition as-is; either subclass it or use Command.WithTimeout() or Command.Until() to give it one. If you only wish to execute a Runnable once, use InstantCommand.
This class is provided by the NewCommands VendorDep
◆ RunCommand() [1/4]
frc2::RunCommand::RunCommand |
( |
std::function< void()> |
toRun, |
|
|
std::initializer_list< Subsystem * > |
requirements |
|
) |
| |
Creates a new RunCommand.
The Runnable will be run continuously until the command ends. Does not run when disabled.
- Parameters
-
toRun | the Runnable to run |
requirements | the subsystems to require |
◆ RunCommand() [2/4]
frc2::RunCommand::RunCommand |
( |
std::function< void()> |
toRun, |
|
|
std::span< Subsystem *const > |
requirements = {} |
|
) |
| |
|
explicit |
Creates a new RunCommand.
The Runnable will be run continuously until the command ends. Does not run when disabled.
- Parameters
-
toRun | the Runnable to run |
requirements | the subsystems to require |
◆ RunCommand() [3/4]
frc2::RunCommand::RunCommand |
( |
RunCommand && |
other | ) |
|
|
default |
◆ RunCommand() [4/4]
frc2::RunCommand::RunCommand |
( |
const RunCommand & |
other | ) |
|
|
default |
The documentation for this class was generated from the following file: