Class BLineUtil
BLine Utility
Loads BLine path (.json) files from the deploy directory and builds named autonomous routines from those paths.
Usage
For example, inside Robot.configureAutons(), you can create a
BLineUtil.BLineConfig, pass in the auton name, factory method, and path names, then register it
with AutonOpMode via BLineUtil.BLineConfig.register().
AutonFactory factory = new AutonFactory(swerve);
BLineConfig scoreAutonConfig = new BLineConfig(
"Score",
factory::score,
"Score Path");
scoreAutonConfig.register();
The factory method receives the loaded paths in the order listed and returns a BLineAuton. Use BLineUtil.BLineConfig.register() for a regular option, or BLineUtil.BLineConfig.registerDefault() for the chooser's default option. A config can also register
directly with a LoggedNetworkChooser when a custom chooser is used. The methods without a
chooser register the routine with AutonOpMode.
Path names are checked when the configuration is created. Missing paths are reported to the Driver Station with a suggested closest match when one is available.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BLineUtil
private BLineUtil()
-
-
Method Details
-
loadPaths
Loads multiple BLine paths in the order given. Each name is passed toload(String).If a path cannot be loaded or found, an error is reported to the Driver Station, and null is returned in the corresponding position.
- Parameters:
names- BLine path names to load- Returns:
- The corresponding paths where entries that fail to load are
null
-
load
-