Package 

Class Command


  • 
    public abstract class Command
    
                        

    Base class for all robot commands.

    Commands are independent subroutines that are executed periodically.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum Command.State
    • Method Summary

      Modifier and Type Method Description
      String getName() Gets the current command name.
      Command.State getState() Gets the current command state.
      boolean getIsCompleted() Gets a value indicating whether or not command execution is completed.
      void setIsCompleted(boolean isCompleted) Set the command completed state.
      boolean getIsRunnable() Gets a value indicating whether or not command is supposed to execute based on its start condition.
      final void start() Starts the command execution.This allows for commands to execute any initialization code.
      final void stop() Stops the command execution.This allows for commands to execute any cleanup code.
      abstract void periodic() Command periodic code while the command is running.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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.