Class Limelight.PipelineConfiguration
java.lang.Object
com.limelightvision.Limelight.PipelineConfiguration
- Enclosing class:
Limelight
An immutable, validated pipeline configuration override. It holds the contents of a .vpr file.
Create it one time during robot initialization. All file IO and size validation happen at that
time. Then publish it at any time with
Limelight.setPipelineConfigurationOverride(PipelineConfiguration):
// robotInit
PipelineConfiguration aiming = Limelight.PipelineConfiguration.fromDeployFolder("aiming");
PipelineConfiguration intake = Limelight.PipelineConfiguration.fromDeployFolder("intake");
// mid-match
camera.setPipelineConfigurationOverride(aiming);
A failed load produces an instance where isValid() is false.
-
Method Summary
Modifier and TypeMethodDescriptionfromDeployFolder(String deployRelativePath) Reads a .vpr pipeline file from the deploy directory of the robot program (src/main/deployin the robot project).fromString(String contents) Wraps .vpr contents.Returns why this configuration is or is not usable.booleanisValid()Returns true if this holds a usable configuration.intReturns the configuration's size in bytes, or 0 when invalid.
-
Method Details
-
fromString
Wraps .vpr contents. Checks theLimelight.MAX_PIPELINE_CONFIGURATION_OVERRIDE_BYTESsize cap one time.- Parameters:
contents- The .vpr pipeline file contents- Returns:
- The wrapped configuration. Not valid when null, empty, or too large
-
fromDeployFolder
Reads a .vpr pipeline file from the deploy directory of the robot program (src/main/deployin the robot project). If the read fails, this method prints a warning and returns a configuration that is not valid.- Parameters:
deployRelativePath- The pipeline file relative to the deploy directory, for example "aiming" or "pipelines/aiming.vpr". ".vpr" is added when missing- Returns:
- The loaded configuration. Check
isValid()
-
isValid
public boolean isValid()Returns true if this holds a usable configuration.- Returns:
- True if this holds a usable configuration
-
getLoadStatus
Returns why this configuration is or is not usable.- Returns:
- Why this configuration is or is not usable
-
sizeBytes
public int sizeBytes()Returns the configuration's size in bytes, or 0 when invalid.- Returns:
- The configuration's size in bytes, or 0 when invalid
-