Package edu.wpi.first.wpilibj.command
Class StartCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj.command.Command
-
- edu.wpi.first.wpilibj.command.InstantCommand
-
- edu.wpi.first.wpilibj.command.StartCommand
-
- All Implemented Interfaces:
Sendable
,AutoCloseable
public class StartCommand extends InstantCommand
AStartCommand
will call thestart()
method of another command when it is initialized and will finish immediately.
-
-
Constructor Summary
Constructors Constructor Description StartCommand(Command commandToStart)
Instantiates aStartCommand
which will start the given command whenever itsinitialize()
is called.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initialize()
The initialize method is called the first time this Command is run after being started.-
Methods inherited from class edu.wpi.first.wpilibj.command.InstantCommand
_initialize, isFinished
-
Methods inherited from class edu.wpi.first.wpilibj.command.Command
cancel, clearRequirements, close, doesRequire, end, execute, getGroup, getName, getSubsystem, initSendable, interrupted, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setName, setRunWhenDisabled, setSubsystem, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
-
-
-
-
Constructor Detail
-
StartCommand
public StartCommand(Command commandToStart)
Instantiates aStartCommand
which will start the given command whenever itsinitialize()
is called.- Parameters:
commandToStart
- theCommand
to start
-
-
Method Detail
-
initialize
protected void initialize()
Description copied from class:Command
The initialize method is called the first time this Command is run after being started.- Overrides:
initialize
in classCommand
-
-