Class Limelight.PipelineConfiguration

java.lang.Object
com.limelightvision.Limelight.PipelineConfiguration
Enclosing class:
Limelight

public static final class Limelight.PipelineConfiguration extends Object
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 Details

    • fromString

      public static Limelight.PipelineConfiguration fromString(String contents)
      Wraps .vpr contents. Checks the Limelight.MAX_PIPELINE_CONFIGURATION_OVERRIDE_BYTES size cap one time.
      Parameters:
      contents - The .vpr pipeline file contents
      Returns:
      The wrapped configuration. Not valid when null, empty, or too large
    • fromDeployFolder

      public static Limelight.PipelineConfiguration fromDeployFolder(String deployRelativePath)
      Reads a .vpr pipeline file from the deploy directory of the robot program ( src/main/deploy in 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

      public Limelight.LoadStatus 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