Class Autonomous
- java.lang.Object
-
- com.lightningrobotics.common.auto.Autonomous
-
public class Autonomous extends java.lang.Object
Autonomous command configuration class. Register autonomous commands withregister(String, Command)
, and load them to the "Autonomous"Shuffleboard
tab 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.Command
getAutonomous()
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 valueCommand
that will be displayed onShuffleboard
.static boolean
hasDashboardWaitCommand()
Configures ifregister(String, Command)
will group command with aWaitCommand
if enabled (setHasDashboardWaitCommand(boolean)
).static void
load()
Loads all commands configured withregister(String, Command)
to "Autonomous" tab onShuffleboard
.static void
register(java.lang.String name, edu.wpi.first.wpilibj2.command.Command cmd)
Add command to list of autonomous commands.static void
setHasDashboardWaitCommand(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 valueCommand
that 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 aWaitCommand
if enabled (setHasDashboardWaitCommand(boolean)
).- Parameters:
name
- Identifier of autonomous command to be displayed onShuffleboard
.cmd
-Command
to be registered.
-
hasDashboardWaitCommand
public static boolean hasDashboardWaitCommand()
Configures ifregister(String, Command)
will group command with aWaitCommand
if enabled (setHasDashboardWaitCommand(boolean)
).- Returns:
true
by 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
-true
if 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:
Command
to be run in Autonomous.
-
-