-
public abstract class CommandBase class for all robot commands.
Commands are independent subroutines that are executed periodically.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumCommand.State
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate Command.Statestateprivate booleanisCompleted
-
Method Summary
Modifier and Type Method Description StringgetName()Gets the current command name. Command.StategetState()Gets the current command state. booleangetIsCompleted()Gets a value indicating whether or not command execution is completed. voidsetIsCompleted(boolean isCompleted)Set the command completed state. booleangetIsRunnable()Gets a value indicating whether or not command is supposed to execute based on its start condition. final voidstart()Starts the command execution.This allows for commands to execute any initialization code. final voidstop()Stops the command execution.This allows for commands to execute any cleanup code. abstract voidperiodic()Command periodic code while the command is running. -
-
Method Detail
-
getState
Command.State getState()
Gets the current command state.
-
getIsCompleted
boolean getIsCompleted()
Gets a value indicating whether or not command execution is completed.
-
setIsCompleted
void setIsCompleted(boolean isCompleted)
Set the command completed state.
- Parameters:
isCompleted- a boolean value indicating whether or not the command is completed.
-
getIsRunnable
boolean getIsRunnable()
Gets a value indicating whether or not command is supposed to execute based on its start condition.
-
start
final void start()
Starts the command execution.This allows for commands to execute any initialization code.
This method is automatically called by the CommandScheduler.
-
stop
final void stop()
Stops the command execution.This allows for commands to execute any cleanup code.
This method is automatically called by the CommandScheduler.
-
periodic
abstract void periodic()
Command periodic code while the command is running.
-
-
-
-