Class Autonomous
- java.lang.Object
-
- com.lightningrobotics.common.auto.Autonomous
-
public class Autonomous extends java.lang.ObjectAutonomous command configuration class. Register autonomous commands withregister(String, Command), and load them to the "Autonomous"Shuffleboardtab withload().
-
-
Constructor Summary
Constructors Constructor Description Autonomous()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static edu.wpi.first.wpilibj2.command.CommandgetAutonomous()Gets the command selected onShuffleboard.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 valueCommandthat will be displayed onShuffleboard.static booleanhasDashboardWaitCommand()Configures ifregister(String, Command)will group command with aWaitCommandif enabled (setHasDashboardWaitCommand(boolean)).static voidload()Loads all commands configured withregister(String, Command)to "Autonomous" tab onShuffleboard.static voidregister(java.lang.String name, edu.wpi.first.wpilibj2.command.Command cmd)Add command to list of autonomous commands.static voidsetHasDashboardWaitCommand(boolean hasWait)Configures ifregister(String, Command)will group command with aWaitCommand.
-
-
-
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 valueCommandthat will be displayed onShuffleboard.- 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 aWaitCommandif enabled (setHasDashboardWaitCommand(boolean)).- Parameters:
name- Identifier of autonomous command to be displayed onShuffleboard.cmd-Commandto be registered.
-
hasDashboardWaitCommand
public static boolean hasDashboardWaitCommand()
Configures ifregister(String, Command)will group command with aWaitCommandif enabled (setHasDashboardWaitCommand(boolean)).- Returns:
trueby default (setHasDashboardWaitCommand(boolean)not called), value set bysetHasDashboardWaitCommand(boolean)otherwise.
-
setHasDashboardWaitCommand
public static void setHasDashboardWaitCommand(boolean hasWait)
Configures ifregister(String, Command)will group command with aWaitCommand.- Parameters:
hasWait-trueif there needs to be aWaitCommand, false otherwise.
-
load
public static void load()
Loads all commands configured withregister(String, Command)to "Autonomous" tab onShuffleboard. Selection menu will have name "Auto Mode".
-
getAutonomous
public static edu.wpi.first.wpilibj2.command.Command getAutonomous()
Gets the command selected onShuffleboard.- Returns:
Commandto be run in Autonomous.
-
-