Class Autonomous


  • public class Autonomous
    extends java.lang.Object
    Autonomous command configuration class. Register autonomous commands with register(String, Command), and load them to the "Autonomous" Shuffleboard tab with load().
    • Constructor Detail

      • Autonomous

        public Autonomous()
    • Method Detail

      • getCommands

        public static java.util.HashMap<java.lang.String,​edu.wpi.first.wpilibj2.command.Command> getCommands()
        Map of autonomous commands where the key (String) corresponds to the name of the value Command that will be displayed on Shuffleboard.
        Returns:
        the map of commands registered with register(String, Command)
      • register

        public static void register​(java.lang.String name,
                                    edu.wpi.first.wpilibj2.command.Command cmd)
        Add command to list of autonomous commands. Will group with a WaitCommand if enabled (setHasDashboardWaitCommand(boolean)).
        Parameters:
        name - Identifier of autonomous command to be displayed on Shuffleboard.
        cmd - Command to be registered.
      • setHasDashboardWaitCommand

        public static void setHasDashboardWaitCommand​(boolean hasWait)
        Configures if register(String, Command) will group command with a WaitCommand.
        Parameters:
        hasWait - true if there needs to be a WaitCommand, false otherwise.
      • load

        public static void load()
        Loads all commands configured with register(String, Command) to "Autonomous" tab on Shuffleboard. Selection menu will have name "Auto Mode".
      • getAutonomous

        public static edu.wpi.first.wpilibj2.command.Command getAutonomous()
        Gets the command selected on Shuffleboard.
        Returns:
        Command to be run in Autonomous.