Class LimelightResults

java.lang.Object
com.limelightvision.LimelightResults

public class LimelightResults extends Object
The complete decoded results for one frame. All fields come from one MessagePack payload.
  • Field Details

    • valid

      public boolean valid
      True if at least one target is valid in this frame.
    • timestampMillis

      public double timestampMillis
      Legacy timestamp in milliseconds since vision-process boot.
    • timestampMicros

      public long timestampMicros
      Microseconds since vision-process boot.
    • systemTimestampMicros

      public long systemTimestampMicros
      System wall-clock time in microseconds since epoch.
    • ntTimestampMicros

      public long ntTimestampMicros
      NetworkTables server time in microseconds. 0 if the camera is not connected to a server
    • frameIndex

      public long frameIndex
      Frame counter starting at 0, or -1 before the first frame.
    • targetingLatencyMillis

      public double targetingLatencyMillis
      Targeting/pipeline latency in milliseconds.
    • captureLatencyMillis

      public double captureLatencyMillis
      Capture latency in milliseconds.
    • pipelineIndex

      public double pipelineIndex
      Active pipeline index.
    • pipelineType

      public String pipelineType
      Active pipeline type (e.g. "pipe_fiducial")
    • focusMetric

      public double focusMetric
      Focus metric for focus-assist.
    • stdDevsMT1

      public double[] stdDevsMT1
      Camera-reported MegaTag1 standard deviations [x, y, z, roll, pitch, yaw]. The camera averages these over a long window. Use for telemetry only. Do not use for fusion
    • stdDevsMT2

      public double[] stdDevsMT2
      Camera-reported MegaTag2 standard deviations [x, y, z, roll, pitch, yaw]. The camera averages these over a long window. Use for telemetry only. Do not use for fusion
    • robotPoseMT1

      public double[] robotPoseMT1
      MegaTag1 robot pose in field space [x, y, z, roll, pitch, yaw] (meters, degrees).
    • robotPoseMT1WpiRed

      public double[] robotPoseMT1WpiRed
      MegaTag1 robot pose, WPILib red-alliance coordinate system.
    • robotPoseMT1WpiBlue

      public double[] robotPoseMT1WpiBlue
      MegaTag1 robot pose, WPILib blue-alliance coordinate system.
    • robotPoseMT2

      public double[] robotPoseMT2
      MegaTag2 robot pose in field space.
    • robotPoseMT2WpiRed

      public double[] robotPoseMT2WpiRed
      MegaTag2 robot pose, WPILib red-alliance coordinate system.
    • robotPoseMT2WpiBlue

      public double[] robotPoseMT2WpiBlue
      MegaTag2 robot pose, WPILib blue-alliance coordinate system.
    • reportedTagCount

      public int reportedTagCount
      Number of AprilTags contributing to the botpose estimates.
    • tagSpanMeters

      public double tagSpanMeters
      Max distance between contributing tags in meters.
    • avgTagDistanceMeters

      public double avgTagDistanceMeters
      Average distance to contributing tags in meters.
    • avgTagAreaPercent

      public double avgTagAreaPercent
      Average area of contributing tags (percentage of image).
    • cameraPoseRobotSpace

      public double[] cameraPoseRobotSpace
      Final camera pose in robot space [x, y, z, roll, pitch, yaw] (meters, degrees).
    • pythonOutput

      public double[] pythonOutput
      Data set by a python snapscript via llpython.
    • txDegrees

      public double txDegrees
      Horizontal offset from crosshair to primary target in degrees.
    • tyDegrees

      public double tyDegrees
      Vertical offset from crosshair to primary target in degrees.
    • txDegreesNoCrosshair

      public double txDegreesNoCrosshair
      Horizontal offset from principal pixel to primary target in degrees.
    • tyDegreesNoCrosshair

      public double tyDegreesNoCrosshair
      Vertical offset from principal pixel to primary target in degrees.
    • targetAreaPercent

      public double targetAreaPercent
      Primary target area (percentage of image, 0-100).
    • targetDistanceMeters

      public double targetDistanceMeters
      3D distance from camera to primary target in meters.
    • retroTargets

      public RetroTarget[] retroTargets
    • fiducialTargets

      public FiducialTarget[] fiducialTargets
    • detectorTargets

      public DetectorTarget[] detectorTargets
    • classifierTargets

      public ClassifierTarget[] classifierTargets
    • classifierTargetsRejected

      public ClassifierTarget[] classifierTargetsRejected
      Classifier results below the confidence threshold. For visualization and debugging
    • barcodeTargets

      public BarcodeTarget[] barcodeTargets
    • counterTargets

      public CounterTarget[] counterTargets
    • ocrTargets

      public OCRTarget[] ocrTargets
    • imu

      public IMUData imu
    • hardware

      public HardwareData hardware
    • rewind

      public RewindData rewind
    • robotOrientation

      public RobotOrientationData robotOrientation
    • intrinsics

      public CameraIntrinsics intrinsics
    • imageSource

      public int imageSource
      Image source index.
    • hardwareType

      public int hardwareType
      Hardware type identifier.
    • uiRefresh

      public int uiRefresh
      UI refresh counter.
    • ignoreNT

      public boolean ignoreNT
      True if the camera is ignoring NetworkTables input.
    • ntConnected

      public boolean ntConnected
      True if the camera is connected to a NetworkTables server.
    • pipelineConfigurationOverrideActive

      public boolean pipelineConfigurationOverrideActive
      True if the camera is running a robot-published pipeline configuration override.
    • pipelineConfigurationOverrideState

      public PipelineConfigurationOverrideState pipelineConfigurationOverrideState
      Pipeline configuration override state reported by the camera.
    • sharedMapActive

      public boolean sharedMapActive
      True if the camera is localizing against the robot-published shared field map.
    • sharedMapState

      public SharedMapState sharedMapState
      Shared field map state reported by the camera.
    • parseLatencyMillis

      public double parseLatencyMillis
      Time spent decoding this envelope in robot code, in milliseconds. It happens in this library, not in the camera, so it is not part of the camera's latency. Useful for logging.
    • receiveTimestampSeconds

      public double receiveTimestampSeconds
      Local NetworkTables time when this frame arrived, in seconds. 0 if this object did not come from the network
    • error

      public String error
      Non-empty if the envelope failed to decode.
  • Constructor Details

    • LimelightResults

      public LimelightResults()
  • Method Details

    • getAgeSeconds

      public double getAgeSeconds()
      Returns seconds since this frame arrived.
      Returns:
      Seconds since this frame arrived. If this value keeps growing, the camera has stopped sending frames. Possible causes: disconnected, stopped, or renamed.
    • getTargetCount

      public int getTargetCount()
      Returns total number of retro, fiducial, detector, classifier, and barcode targets.
      Returns:
      Total number of retro, fiducial, detector, classifier, and barcode targets. Counter and OCR results are not included
    • getRobotPose_MT1

      public org.wpilib.math.geometry.Pose3d getRobotPose_MT1()
      Returns megaTag1 robot pose in field space (field-center origin).
      Returns:
      MegaTag1 robot pose in field space (field-center origin)
    • getRobotPose_MT2

      public org.wpilib.math.geometry.Pose3d getRobotPose_MT2()
      Returns megaTag2 robot pose in field space.
      Returns:
      MegaTag2 robot pose in field space. The origin is the field center
    • getRobotPose

      public org.wpilib.math.geometry.Pose3d getRobotPose(PoseEstimateType type)
      Returns the full 3D robot pose for the given estimate type.
      Returns:
      The full 3D robot pose for the given estimate type. The type selects the origin and the algorithm
    • getCameraPose_RobotSpace

      public org.wpilib.math.geometry.Pose3d getCameraPose_RobotSpace()
      Returns camera pose in robot space (meters, degrees).
      Returns:
      Camera pose in robot space (meters, degrees)