Package limelight.sim

Class LimelightSimSettings

java.lang.Object
limelight.sim.LimelightSimSettings

public class LimelightSimSettings extends Object
Configurable properties describing a simulated Limelight camera, used by LimelightSim.

The defaults approximate a Limelight 3 running the AprilTag pipeline at 1280x960 and require no configuration to get a usable simulation running. Construct one with new LimelightSimSettings() and tweak only the fields that matter for your camera with the withXXX methods.

  • Constructor Details

    • LimelightSimSettings

      public LimelightSimSettings()
      Construct LimelightSimSettings with defaults approximating a Limelight 3.
  • Method Details

    • withResolution

      public LimelightSimSettings withResolution(double widthPixels, double heightPixels)
      Set the simulated sensor resolution.
      Parameters:
      widthPixels - Horizontal resolution in pixels.
      heightPixels - Vertical resolution in pixels.
      Returns:
      LimelightSimSettings for chaining.
    • withFOV

      public LimelightSimSettings withFOV(double horizontalDegrees, double verticalDegrees)
      Set the simulated camera's field of view.
      Parameters:
      horizontalDegrees - Horizontal field of view in degrees.
      verticalDegrees - Vertical field of view in degrees.
      Returns:
      LimelightSimSettings for chaining.
    • withTagSize

      public LimelightSimSettings withTagSize(double sizeMeters)
      Set the physical size of the AprilTags being detected.
      Parameters:
      sizeMeters - Edge-to-edge size of the tag's black square, in meters.
      Returns:
      LimelightSimSettings for chaining.
    • withMaxDetectionRange

      public LimelightSimSettings withMaxDetectionRange(double rangeMeters)
      Set the maximum distance a tag may be detected from.
      Parameters:
      rangeMeters - Maximum detection range, in meters.
      Returns:
      LimelightSimSettings for chaining.
    • withMaxTagIncidenceAngle

      public LimelightSimSettings withMaxTagIncidenceAngle(double degrees)
      Set the maximum angle of incidence a tag may be viewed at before it is considered too edge-on to detect.
      Parameters:
      degrees - Maximum incidence angle, in degrees.
      Returns:
      LimelightSimSettings for chaining.
    • withPipelineLatency

      public LimelightSimSettings withPipelineLatency(double avgMs, double stdDevMs)
      Set the simulated pipeline processing latency ("tl").
      Parameters:
      avgMs - Average latency, in milliseconds.
      stdDevMs - Standard deviation of the latency, in milliseconds.
      Returns:
      LimelightSimSettings for chaining.
    • withCaptureLatency

      public LimelightSimSettings withCaptureLatency(double avgMs)
      Set the simulated capture latency ("cl").
      Parameters:
      avgMs - Average capture latency, in milliseconds.
      Returns:
      LimelightSimSettings for chaining.
    • withAngleNoise

      public LimelightSimSettings withAngleNoise(double stdDevDegrees)
      Set the noise applied to tx/ty/txnc/tync readings.
      Parameters:
      stdDevDegrees - Standard deviation of the angular noise, in degrees.
      Returns:
      LimelightSimSettings for chaining.
    • withPoseNoise

      public LimelightSimSettings withPoseNoise(double translationStdDevMeters, double rotationStdDevDegrees)
      Set the noise applied to botpose translation and rotation readings, for a single tag seen at 1 meter.
      Parameters:
      translationStdDevMeters - Standard deviation of the translation noise, in meters.
      rotationStdDevDegrees - Standard deviation of the rotation noise, in degrees.
      Returns:
      LimelightSimSettings for chaining.
    • withRandomSeed

      public LimelightSimSettings withRandomSeed(long seed)
      Set the seed used for the deterministic noise source.
      Parameters:
      seed - Random seed.
      Returns:
      LimelightSimSettings for chaining.
    • withPipelineType

      public LimelightSimSettings withPipelineType(String type)
      Set the pipeline type string reported by "getpipetype".
      Parameters:
      type - Pipeline type, e.g. "pipe_fiducial".
      Returns:
      LimelightSimSettings for chaining.
    • perfect

      public static LimelightSimSettings perfect()
      Create LimelightSimSettings with all noise and latency zeroed out, useful for deterministic testing.
      Returns:
      LimelightSimSettings with no noise or latency.