Package limelight.networktables
Class LimelightTargetData
java.lang.Object
limelight.networktables.LimelightTargetData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the current AprilTag ID targettedGets the camera's 3D pose with respect to the currently tracked target's coordinate system.intGets the classifier class index from the currently running neural classifier pipelineintGets the detector class index from the primary result of the currently running neural detector pipeline.doubleGets the horizontal offset from the crosshair to the target in degrees.doubleGets the horizontal offset from the principal pixel/point to the target in degrees.Get the neural class name of the target.Gets the robot's 3D pose with respect to the currently tracked target's coordinate system.doubleGets the target area as a percentage of the image (0-100%).double[]Get the target color in HSV/RGB format.intGets the number of targets currently detected.double[]T2D is an array that contains several targeting metrcisbooleanDoes theLimelighthave a valid target?Gets the target's 3D pose with respect to the camera's coordinate system.Gets the target's 3D pose with respect to the robot's coordinate system.doubleGets the vertical offset from the crosshair to the target in degrees.doubleGets the vertical offset from the principal pixel/point to the target in degrees.
-
Constructor Details
-
LimelightTargetData
Construct data for targets.- Parameters:
camera-Limelightto use.
-
-
Method Details
-
getAprilTagID
public double getAprilTagID()Get the current AprilTag ID targetted- Returns:
- AprilTag ID.
-
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
Gets the robot's 3D pose with respect to the currently tracked target's coordinate system.- Returns:
Pose3dobject representing the robot's position and orientation relative to the target
-
getCameraToTarget
Gets the camera's 3D pose with respect to the currently tracked target's coordinate system.- Returns:
Pose3dobject representing the camera's position and orientation relative to the target
-
getTargetToCamera
Gets the target's 3D pose with respect to the camera's coordinate system.- Returns:
Pose3dobject representing the target's position and orientation relative to the camera
-
getTargetToRobot
Gets the target's 3D pose with respect to the robot's coordinate system.- Returns:
Pose3dobject representing the target's position and orientation relative to the robot
-
getTargetStatus
public boolean getTargetStatus()Does theLimelighthave 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
-