Package edu.wpi.first.wpilibj.command
Class StartCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj.SendableBase
-
- 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
AStartCommandwill call thestart()method of another command when it is initialized and will finish immediately.
-
-
Constructor Summary
Constructors Constructor Description StartCommand(Command commandToStart)Instantiates aStartCommandwhich will start the given command whenever itsinitialize()is called.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinitialize()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, doesRequire, end, execute, getGroup, initSendable, interrupted, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
-
Methods inherited from class edu.wpi.first.wpilibj.SendableBase
addChild, close, free, getName, getSubsystem, setName, setName, setName, setSubsystem
-
-
-
-
Constructor Detail
-
StartCommand
public StartCommand(Command commandToStart)
Instantiates aStartCommandwhich will start the given command whenever itsinitialize()is called.- Parameters:
commandToStart- theCommandto start
-
-
Method Detail
-
initialize
protected void initialize()
Description copied from class:CommandThe initialize method is called the first time this Command is run after being started.- Overrides:
initializein classCommand
-
-