- Direct Known Subclasses:
public class InstantCommand extends CommandBase
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
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
public InstantCommand()Creates a new InstantCommand with a Runnable that does nothing. Useful only as a no-arg constructor to call implicitly from subclass constructors.
public void initialize()Description copied from interface:
CommandThe initial subroutine of a command. Called once when the command is initially scheduled.
public final boolean isFinished()Description copied from interface:
CommandWhether the command has finished. Once a command finishes, the scheduler will call its end() method and un-schedule it.
- whether the command has finished.