Skip to main content
A Limelight pipeline defines how the camera processes each frame — which algorithm runs, what targets are reported, and how pose data is computed. You configure pipelines in the Limelight web UI and switch between them from your robot code at runtime.

Pipeline slots

Limelight supports up to 10 pipelines, indexed 0 through 9. Each slot is configured independently in the web UI. You can assign a different algorithm type to each slot:
TypeDescription
Retroreflective / colorTracks bright retroreflective tape or colored regions
AprilTag / fiducialDetects and solves pose for AprilTag markers
Neural classifierRuns an image classifier neural network
Neural detectorRuns an object detection neural network
BarcodeDecodes QR codes, Data Matrix, and other barcodes

Switching pipelines at runtime

Use setPipelineIndex to switch the active pipeline by index:
// Switch to pipeline 0
LimelightHelpers.setPipelineIndex("limelight", 0);

// Switch to pipeline 2 (e.g., a neural detector pipeline)
LimelightHelpers.setPipelineIndex("limelight", 2);
This writes to the pipeline NetworkTables entry on the camera’s table.

Reading pipeline state

// Returns the active pipeline index as a double (0.0–9.0)
double index = LimelightHelpers.getCurrentPipelineIndex("limelight");

// Returns a string like "retro", "apriltag", "neuralclassifier",
// "neuraldetector", or "barcode"
String type = LimelightHelpers.getCurrentPipelineType("limelight");
getCurrentPipelineIndex reads from the getpipe NT entry, and getCurrentPipelineType reads from getpipetype.

AprilTag-specific controls

Priority tag ID

When multiple AprilTags are visible, use setPriorityTagID to tell the Limelight which tag to prioritize for tx, ty, and single-tag pose output:
LimelightHelpers.setPriorityTagID("limelight", 4);
This writes to the priorityid NT entry.

Fiducial ID filter

Use SetFiducialIDFiltersOverride to limit which tag IDs are used for robot localization. Tags not in the list are detected but ignored for pose estimation:
// Only use tags 1, 2, 3, and 4 for localization
int[] allowedTags = {1, 2, 3, 4};
LimelightHelpers.SetFiducialIDFiltersOverride("limelight", allowedTags);

Detection downscaling

SetFiducialDownscalingOverride controls how much the image is downscaled before AprilTag detection. Higher downscale factors improve CPU performance but may reduce detection range:
// Let the pipeline setting control downscale (default)
LimelightHelpers.SetFiducialDownscalingOverride("limelight", 0.0f);

// Force 2× downscale
LimelightHelpers.SetFiducialDownscalingOverride("limelight", 2.0f);
Valid values: 0.0 (pipeline control), 1.0, 1.5, 2.0, 3.0, 4.0.

Target count

getTargetCount reads from the t2d array (index 1) and returns the number of targets currently detected:
int count = LimelightHelpers.getTargetCount("limelight");
The full t2d array is a 17-element snapshot of targeting metrics for the current frame. You can read it directly with getT2DArray:
double[] t2d = LimelightHelpers.getT2DArray("limelight");
The t2d array contains 17 elements. The library only reads this array when its length is exactly 17.
IndexFieldDescription
0targetValid1.0 if a valid target is present
1targetCountNumber of targets detected
2targetLatencyPipeline processing latency in ms
3captureLatencyCapture latency in ms
4txHorizontal offset from crosshair to target, degrees
5tyVertical offset from crosshair to target, degrees
6txncHorizontal offset from principal point to target, degrees
7tyncVertical offset from principal point to target, degrees
8taTarget area as percentage of image
9tidFiducial ID of the primary target
10targetClassIndexDetectorClass index from a neural detector pipeline
11targetClassIndexClassifierClass index from a neural classifier pipeline
12targetLongSidePixelsLong side of the target bounding box in pixels
13targetShortSidePixelsShort side of the target bounding box in pixels
14targetHorizontalExtentPixelsHorizontal extent of target bounding box in pixels
15targetVerticalExtentPixelsVertical extent of target bounding box in pixels
16targetSkewDegreesTarget skew in degrees

Build docs developers (and LLMs) love