WPILibC++ 2024.3.2
|
A Command that runs instantly; it will initialize, execute once, and end on the same iteration of the scheduler. More...
#include <frc2/command/InstantCommand.h>
Public Member Functions | |
InstantCommand (std::function< void()> toRun, Requirements requirements={}) | |
Creates a new InstantCommand that runs the given Runnable with the given requirements. More... | |
InstantCommand (InstantCommand &&other)=default | |
InstantCommand (const InstantCommand &other)=default | |
InstantCommand () | |
Creates a new InstantCommand with a Runnable that does nothing. More... | |
Public Member Functions inherited from frc2::CommandHelper< FunctionalCommand, InstantCommand > | |
CommandHelper ()=default | |
CommandPtr | ToPtr () &&override |
Additional Inherited Members | |
Protected Member Functions inherited from frc2::CommandHelper< FunctionalCommand, InstantCommand > | |
std::unique_ptr< Command > | TransferOwnership () &&override |
A Command that runs instantly; it will initialize, execute once, and end on the same iteration of the scheduler.
Users can either pass in a Runnable and a set of requirements, or else subclass this command if desired.
This class is provided by the NewCommands VendorDep
|
explicit |
Creates a new InstantCommand that runs the given Runnable with the given requirements.
toRun | the Runnable to run |
requirements | the subsystems required by this command |
|
default |
|
default |
frc2::InstantCommand::InstantCommand | ( | ) |
Creates a new InstantCommand with a Runnable that does nothing.
Useful only as a no-arg constructor to call implicitly from subclass constructors.