Class LimelightTargetData

java.lang.Object
limelight.networktables.LimelightTargetData

public class LimelightTargetData extends Object
  • Constructor Details

    • LimelightTargetData

      public LimelightTargetData(Limelight camera)
      Construct data for targets.
      Parameters:
      camera - Limelight to use.
  • Method Details

    • getAprilTagID

      public double getAprilTagID()
      Get the current AprilTag ID targetted
      Returns:
      AprilTag ID.
    • getNeuralClassID

      public String getNeuralClassID()
      Get the neural class name of the target.
      Returns:
      Neural class name.
    • getTargetColor

      public double[] getTargetColor()
      Get the target color in HSV/RGB format.
      Returns:
      Target color in HSV/RGB format
    • getRobotToTarget

      public Pose3d getRobotToTarget()
      Gets the robot's 3D pose with respect to the currently tracked target's coordinate system.
      Returns:
      Pose3d object representing the robot's position and orientation relative to the target
    • getCameraToTarget

      public Pose3d getCameraToTarget()
      Gets the camera's 3D pose with respect to the currently tracked target's coordinate system.
      Returns:
      Pose3d object representing the camera's position and orientation relative to the target
    • getTargetToCamera

      public Pose3d getTargetToCamera()
      Gets the target's 3D pose with respect to the camera's coordinate system.
      Returns:
      Pose3d object representing the target's position and orientation relative to the camera
    • getTargetToRobot

      public Pose3d getTargetToRobot()
      Gets the target's 3D pose with respect to the robot's coordinate system.
      Returns:
      Pose3d object representing the target's position and orientation relative to the robot
    • getTargetStatus

      public boolean getTargetStatus()
      Does the Limelight have a valid target?
      Returns:
      True if a valid target is present, false otherwise
    • getHorizontalOffset

      public double getHorizontalOffset()
      Gets the horizontal offset from the crosshair to the target in degrees.
      Returns:
      Horizontal offset angle in degrees
    • getVerticalOffset

      public double getVerticalOffset()
      Gets the vertical offset from the crosshair to the target in degrees.
      Returns:
      Vertical offset angle in degrees
    • getHorizontalOffsetFromPrincipal

      public double getHorizontalOffsetFromPrincipal()
      Gets the horizontal offset from the principal pixel/point to the target in degrees. This is the most accurate 2d metric if you are using a calibrated camera and you don't need adjustable crosshair functionality.
      Returns:
      Horizontal offset angle in degrees
    • getVerticalOffsetFromPrincipal

      public double getVerticalOffsetFromPrincipal()
      Gets the vertical offset from the principal pixel/point to the target in degrees. This is the most accurate 2d metric if you are using a calibrated camera and you don't need adjustable crosshair functionality.
      Returns:
      Horizontal offset angle in degrees
    • getTargetArea

      public double getTargetArea()
      Gets the target area as a percentage of the image (0-100%).
      Returns:
      Target area percentage (0-100)
    • getTargetMetrics

      public double[] getTargetMetrics()
      T2D is an array that contains several targeting metrcis
      Returns:
      Array containing [targetValid, targetCount, targetLatency, captureLatency, tx, ty, txnc, tync, ta, tid, targetClassIndexDetector, targetClassIndexClassifier, targetLongSidePixels, targetShortSidePixels, targetHorizontalExtentPixels, targetVerticalExtentPixels, targetSkewDegrees]
    • getTargetCount

      public int getTargetCount()
      Gets the number of targets currently detected.
      Returns:
      Number of detected targets
    • getClassifierClassIndex

      public int getClassifierClassIndex()
      Gets the classifier class index from the currently running neural classifier pipeline
      Returns:
      Class index from classifier pipeline
    • getDetectorClassIndex

      public int getDetectorClassIndex()
      Gets the detector class index from the primary result of the currently running neural detector pipeline.
      Returns:
      Class index from detector pipeline