Class PathPlannerUtil.PathPlannerConfig

java.lang.Object
com.stuypulse.robot.util.auton.PathPlannerUtil.PathPlannerConfig
Enclosing class:
PathPlannerUtil

public static class PathPlannerUtil.PathPlannerConfig extends Object

PathPlanner Configuration

Associates an autonomous routine name and one or more PathPlanner path names with a factory method that creates the corresponding PathPlannerAuton. Create one configuration for each routine, then call one of the register methods to add it to an autonomous chooser.

  • Field Details

  • Constructor Details

    • PathPlannerConfig

      public PathPlannerConfig(String name, Function<com.pathplanner.lib.path.PathPlannerPath[], PathPlannerAuton> auton, String... paths)

      Constructor for a PathPlannerConfig

      Stores the routine name, path names, and factory. Checks if every path exists and reports missing paths and suggested closest matches to the Driver Station.

      Parameters:
      name - The name to display for this autonomous routine
      auton - Factory that creates the routine from the loaded paths
      paths - PathPlanner path names used by the routine, in the order expected by the factory
  • Method Details

    • buildPathPlannerAuton

      Loads the configured paths and passes them to the routine factory.
      Returns:
      The autonomous routine created from the configured paths
    • register

      public PathPlannerUtil.PathPlannerConfig register(org.littletonrobotics.junction.networktables.LoggedNetworkChooser<Auton> chooser)
      Adds this routine to a LoggedNetworkChooser under the configured name.
      Parameters:
      chooser - The chooser that will display this routine
      Returns:
      This instance of the class, for method chaining
    • register

      Registers this routine with AutonOpMode's internal chooser.
      Returns:
      This instance of the class, for method chaining
    • registerDefault

      public PathPlannerUtil.PathPlannerConfig registerDefault(org.littletonrobotics.junction.networktables.LoggedNetworkChooser<Auton> chooser)
      Adds this routine to a LoggedNetworkChooser as its default option.
      Parameters:
      chooser - The chooser that will display this routine.
      Returns:
      This instance of the class, for method chaining
    • registerDefault

      Registers this routine as the default with AutonOpMode's internal chooser.
      Returns:
      This instance of the class, for method chaining