Class NamedCommands

java.lang.Object
com.pathplanner.lib.auto.NamedCommands

public class NamedCommands extends Object
Utility class for managing named commands
  • Constructor Details

    • NamedCommands

      public NamedCommands()
  • Method Details

    • registerCommand

      public static void registerCommand(String name, Command command)
      Registers a command with the given name.
      Parameters:
      name - the name of the command
      command - the command to register
    • registerCommands

      public static void registerCommands(List<Pair<String,Command>> commands)
      Registers a list of commands with their associated names.
      Parameters:
      commands - the list of commands to register
    • registerCommands

      public static void registerCommands(Map<String,Command> commands)
      Registers a map of commands with their associated names.
      Parameters:
      commands - the map of commands to register
    • hasCommand

      public static boolean hasCommand(String name)
      Returns whether a command with the given name has been registered.
      Parameters:
      name - the name of the command to check
      Returns:
      true if a command with the given name has been registered, false otherwise
    • getCommand

      public static Command getCommand(String name)
      Returns the command with the given name.
      Parameters:
      name - the name of the command to get
      Returns:
      the command with the given name, wrapped in a functional command, or a none command if it has not been registered