public abstract class SingleActionCommand extends Command
m_locked, m_nextCommand, m_previousCommand, m_running, m_state| Constructor and Description |
|---|
SingleActionCommand() |
SingleActionCommand(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
end()
Called when the command ended peacefully.
|
protected void |
initialize()
The initialize method is called the first time this Command is run after
being started.
|
protected void |
interrupted()
Called when the command ends because somebody called
cancel()
or another command shared the same requirements as this one, and booted
it out. |
protected boolean |
isFinished()
Returns whether this command is finished.
|
_cancel, _end, _execute, _initialize, _interrupted, cancel, doesRequire, execute, getGroup, getName, getRequirements, getSmartDashboardType, getTable, initTable, isCanceled, isInterruptible, isRunning, isTimedOut, removed, requires, run, setCancelOnModeSwitch, setInterruptible, setParent, setRunWhenDisabled, setTimeout, start, startRunning, timeSinceInitialized, toString, willCancelOnModeSwitch, willRunWhenDisabledpublic SingleActionCommand()
public SingleActionCommand(java.lang.String name)
protected void initialize()
initialize in class Commandprotected boolean isFinished()
end() will be called.
It may be useful for a team to reference the isTimedOut() method
for time-sensitive commands.
isFinished in class CommandisTimedOut()protected void end()
protected void interrupted()
cancel()
or another command shared the same requirements as this one, and booted
it out.
This is where you may want to wrap up loose ends, like shutting off a motor that was being used in the command.
Generally, it is useful to simply call the end() method
within this method
interrupted in class Command