Skip to main content

getTV

Returns whether the camera currently sees a valid target.
boolean hasTarget = LimelightHelpers.getTV("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table. Pass an empty string "" to use the default "limelight" table.
returns
boolean
true if a valid target is present, false otherwise.

getTX

Returns the horizontal offset from the configured crosshair to the primary target, in degrees.
double tx = LimelightHelpers.getTX("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Horizontal offset angle in degrees. Negative values are to the left of the crosshair.

getTY

Returns the vertical offset from the configured crosshair to the primary target, in degrees.
double ty = LimelightHelpers.getTY("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Vertical offset angle in degrees. Negative values are below the crosshair.

getTXNC

Returns the horizontal offset from the principal pixel to the primary target, in degrees. This is the most accurate 2D angular metric when using a calibrated camera and you do not need adjustable crosshair functionality.
double txnc = LimelightHelpers.getTXNC("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Horizontal offset in degrees from the principal pixel, with no crosshair adjustment applied.

getTYNC

Returns the vertical offset from the principal pixel to the primary target, in degrees. Prefer this over getTY for calibrated cameras that do not require a moveable crosshair.
double tync = LimelightHelpers.getTYNC("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Vertical offset in degrees from the principal pixel, with no crosshair adjustment applied.

getTA

Returns the target area as a percentage of the full image (0–100).
double area = LimelightHelpers.getTA("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Target area as a percentage of the image, from 0 (no target) to 100 (full frame).

getT2DArray

Returns an array of 17 targeting metrics in a single NetworkTables read.
double[] t2d = LimelightHelpers.getT2DArray("limelight");
// t2d[0]  = targetValid
// t2d[1]  = targetCount
// t2d[2]  = targetLatency
// t2d[3]  = captureLatency
// t2d[4]  = tx
// t2d[5]  = ty
// t2d[6]  = txnc
// t2d[7]  = tync
// t2d[8]  = ta
// t2d[9]  = tid
// t2d[10] = targetClassIndexDetector
// t2d[11] = targetClassIndexClassifier
// t2d[12] = targetLongSidePixels
// t2d[13] = targetShortSidePixels
// t2d[14] = targetHorizontalExtentPixels
// t2d[15] = targetVerticalExtentPixels
// t2d[16] = targetSkewDegrees
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double[]
A 17-element array: [targetValid, targetCount, targetLatency, captureLatency, tx, ty, txnc, tync, ta, tid, targetClassIndexDetector, targetClassIndexClassifier, targetLongSidePixels, targetShortSidePixels, targetHorizontalExtentPixels, targetVerticalExtentPixels, targetSkewDegrees].

getTargetCount

Returns the number of targets currently detected. Reads index 1 of the T2D array.
int count = LimelightHelpers.getTargetCount("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
int
Number of detected targets. Returns 0 if the T2D array is not the expected length.

getClassifierClass

Returns the class name string from the currently running neural classifier pipeline.
String className = LimelightHelpers.getClassifierClass("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string
The class name of the current classifier result (e.g. "cube", "cone").

getClassifierClassIndex

Returns the numeric class index from the currently running neural classifier pipeline. Reads index 11 of the T2D array.
int classIdx = LimelightHelpers.getClassifierClassIndex("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
int
Class index from the classifier pipeline. Returns 0 if the T2D array is not the expected length.

getDetectorClass

Returns the class name string of the primary result from the currently running neural detector pipeline.
String detectedClass = LimelightHelpers.getDetectorClass("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string
The class name of the primary detector result.

getDetectorClassIndex

Returns the numeric class index of the primary result from the currently running neural detector pipeline. Reads index 10 of the T2D array.
int detectorIdx = LimelightHelpers.getDetectorClassIndex("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
int
Class index from the detector pipeline. Returns 0 if the T2D array is not the expected length.

getLatency_Pipeline

Returns the pipeline processing latency contribution in milliseconds.
double pipelineLatencyMs = LimelightHelpers.getLatency_Pipeline("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Pipeline processing latency in milliseconds.

getLatency_Capture

Returns the image capture latency in milliseconds.
double captureLatencyMs = LimelightHelpers.getLatency_Capture("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Capture latency in milliseconds.

getCurrentPipelineIndex

Returns the index of the currently active pipeline (0–9).
double pipelineIndex = LimelightHelpers.getCurrentPipelineIndex("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Active pipeline index, between 0 and 9 inclusive.

getCurrentPipelineType

Returns a string describing the active pipeline type.
String pipelineType = LimelightHelpers.getCurrentPipelineType("limelight");
// e.g. "retro", "apriltag", "neuraldetector", "neuralclassifier"
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string
Pipeline type identifier string (e.g. "retro", "apriltag").

getJSONDump

Returns the full JSON results string published by the Limelight each frame.
String json = LimelightHelpers.getJSONDump("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string
Raw JSON string containing all current pipeline results.

getLatestResults

Parses the JSON results dump and returns a LimelightResults object. Includes parse timing if profileJSON is enabled.
LimelightHelpers.LimelightResults results = LimelightHelpers.getLatestResults("limelight");

if (results.error == null) {
    double tx = results.tx;
    LimelightHelpers.LimelightTarget_Fiducial[] tags = results.targets_Fiducials;
}
JSON parsing adds latency. Prefer direct NT getters (getTV, getTX, etc.) or getT2DArray for time-critical loops.
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
LimelightResults
Parsed results object. Check results.error for a non-null value before using results.

getFiducialID

Returns the ID of the primary tracked fiducial/AprilTag.
double tagId = LimelightHelpers.getFiducialID("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Fiducial ID of the primary tracked AprilTag, or 0 if none.

getNeuralClassID

Returns the neural classifier class ID string for the primary result.
String classId = LimelightHelpers.getNeuralClassID("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string
Neural classifier class ID string.

getHeartbeat

Returns a counter that increments once per frame. Use this to verify the camera is connected and actively publishing.
double hb = LimelightHelpers.getHeartbeat("limelight");
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double
Heartbeat counter. Rolls over at some large value. If it stops changing, the camera may be disconnected.

getTargetColor

Returns the average color observed under the crosshair region as a BGR array.
double[] color = LimelightHelpers.getTargetColor("limelight");
double blue  = color[0];
double green = color[1];
double red   = color[2];
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double[]
Three-element array in BGR order: [Blue, Green, Red].

getRawBarcodeData

Returns decoded data strings from all barcodes detected in the current frame.
String[] barcodes = LimelightHelpers.getRawBarcodeData("limelight");
for (String data : barcodes) {
    System.out.println("Decoded: " + data);
}
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
string[]
Array of decoded barcode content strings. Empty array if no barcodes are detected.

getCornerCoordinates

Returns the corner coordinates of the primary detected target as a flat array of alternating x/y values. Requires Send Contours to be enabled in the Limelight Output tab.
double[] corners = LimelightHelpers.getCornerCoordinates("limelight");
// corners = [x0, y0, x1, y1, x2, y2, x3, y3, ...]
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
double[]
Flat array of corner coordinates in [x0, y0, x1, y1, ...] order. Empty if no target or Send Contours is disabled.

getRawFiducials

Returns low-latency raw AprilTag detection results directly from NetworkTables, bypassing JSON parsing.
LimelightHelpers.RawFiducial[] fiducials = LimelightHelpers.getRawFiducials("limelight");
for (LimelightHelpers.RawFiducial f : fiducials) {
    System.out.println("Tag ID: " + f.id + ", dist: " + f.distToCamera);
}
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
RawFiducial[]
Array of RawFiducial objects. Each contains: id, txnc, tync, ta, distToCamera, distToRobot, ambiguity. Returns an empty array if data is malformed.

getRawDetections

Returns low-latency raw neural detector results directly from NetworkTables, bypassing JSON parsing.
LimelightHelpers.RawDetection[] detections = LimelightHelpers.getRawDetections("limelight");
for (LimelightHelpers.RawDetection d : detections) {
    System.out.println("Class: " + d.classId + ", txnc: " + d.txnc);
}
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
RawDetection[]
Array of RawDetection objects. Each contains: classId, txnc, tync, ta, and four corner points (corner0_X/Y through corner3_X/Y). Returns an empty array if data is malformed.

getRawTargets

Returns low-latency raw target contour results directly from NetworkTables. Returns ungrouped contours in normalized screen space (−1 to 1).
LimelightHelpers.RawTarget[] targets = LimelightHelpers.getRawTargets("limelight");
for (LimelightHelpers.RawTarget t : targets) {
    System.out.println("txnc: " + t.txnc + ", tync: " + t.tync);
}
limelightName
string
required
Name of the Limelight NetworkTables table.
returns
RawTarget[]
Array of RawTarget objects (up to 3). Each contains: txnc, tync, ta. Returns an empty array if data is malformed.

Build docs developers (and LLMs) love