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
A
StartCommand will call the start() 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
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.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 Details
-
StartCommand
Instantiates aStartCommandwhich will start the given command whenever itsinitialize()is called.- Parameters:
commandToStart- theCommandto start
-
-
Method Details
-
initialize
Description copied from class:CommandThe initialize method is called the first time this Command is run after being started.- Overrides:
initializein classCommand
-