Class BLineUtil.BLineConfig
java.lang.Object
com.stuypulse.robot.util.auton.BLineUtil.BLineConfig
- Enclosing class:
BLineUtil
BLine Configuration
Associates an autonomous routine name and one or more BLine path names with a factory
method that creates the corresponding BLineAuton. Create one configuration for each
routine, then call one of the register methods to add it to an autonomous chooser.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBLineConfig(String name, Function<bline.path.Path[], BLineAuton> auton, String... paths) Constructor for a BLineConfig -
Method Summary
Modifier and TypeMethodDescriptionprivate BLineAutonLoads the configured paths and passes them to the routine factory.register()Registers this routine withAutonOpMode's internal chooser.Adds this routine to aLoggedNetworkChooserunder the configured name.Registers this routine as the default withAutonOpMode's internal chooser.registerDefault(org.littletonrobotics.junction.networktables.LoggedNetworkChooser<Auton> chooser) Adds this routine as the default option in aLoggedNetworkChooser.
-
Field Details
-
name
-
auton
-
paths
-
-
Constructor Details
-
BLineConfig
Constructor for a BLineConfig
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 routineauton- Factory that creates the routine from the loaded pathspaths- BLine path names used by the routine, in the order expected by the factory
-
-
Method Details
-
buildBLineAuton
Loads the configured paths and passes them to the routine factory.- Returns:
- The autonomous routine created from the configured paths
-
register
public BLineUtil.BLineConfig register(org.littletonrobotics.junction.networktables.LoggedNetworkChooser<Auton> chooser) Adds this routine to aLoggedNetworkChooserunder 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 withAutonOpMode's internal chooser.- Returns:
- This instance of the class, for method chaining
-
registerDefault
public BLineUtil.BLineConfig registerDefault(org.littletonrobotics.junction.networktables.LoggedNetworkChooser<Auton> chooser) Adds this routine as the default option in aLoggedNetworkChooser.- 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 withAutonOpMode's internal chooser.- Returns:
- This instance of the class, for method chaining
-