RobotCore
Robot Core Documentation
|
Public Member Functions | |
RunCommand (Runnable toRun, Subsystem... requirements) | |
void | execute () |
Public Member Functions inherited from edu.wpi.first.wpilibj2.command.CommandBase | |
final void | addRequirements (Subsystem... requirements) |
Set< Subsystem > | getRequirements () |
Public Member Functions inherited from edu.wpi.first.wpilibj2.command.Command | |
default void | initialize () |
default void | end (boolean interrupted) |
default boolean | isFinished () |
default ParallelRaceGroup | withTimeout (double seconds) |
default ParallelRaceGroup | withInterrupt (BooleanSupplier condition) |
default SequentialCommandGroup | beforeStarting (Runnable toRun, Subsystem... requirements) |
default SequentialCommandGroup | andThen (Runnable toRun, Subsystem... requirements) |
default SequentialCommandGroup | andThen (Command... next) |
default ParallelDeadlineGroup | deadlineWith (Command... parallel) |
default ParallelCommandGroup | alongWith (Command... parallel) |
default ParallelRaceGroup | raceWith (Command... parallel) |
default PerpetualCommand | perpetually () |
default ProxyScheduleCommand | asProxy () |
default void | schedule (boolean interruptible) |
default void | schedule () |
default void | cancel () |
default boolean | isScheduled () |
default boolean | hasRequirement (Subsystem requirement) |
default boolean | runsWhenDisabled () |
default String | getName () |
Protected Attributes | |
final Runnable | m_toRun |
Protected Attributes inherited from edu.wpi.first.wpilibj2.command.CommandBase | |
Set< Subsystem > | m_requirements = new HashSet<>() |
A command that runs a Runnable continuously. Has no end condition as-is; either subclass it or use Command#withTimeout(double) or Command#withInterrupt(BooleanSupplier) to give it one. If you only wish to execute a Runnable once, use InstantCommand.
edu.wpi.first.wpilibj2.command.RunCommand.RunCommand | ( | Runnable | toRun, |
Subsystem... | requirements | ||
) |
Creates a new RunCommand. The Runnable will be run continuously until the command ends. Does not run when disabled.
toRun | the Runnable to run |
requirements | the subsystems to require |
void edu.wpi.first.wpilibj2.command.RunCommand.execute | ( | ) |
The main body of a command. Called repeatedly while the command is scheduled.
Implements edu.wpi.first.wpilibj2.command.Command.