Skip to main content
Limelight supports two neural network pipeline types:
  • Classifier — classifies the entire camera frame into a single category (e.g., “cargo present” vs. “no cargo”).
  • Detector — detects and locates one or more objects within the frame, returning bounding boxes and class labels.

Classifier pipeline

The classifier pipeline analyzes the full frame and outputs the most likely class. Use it when you need a simple yes/no or category answer about what the camera is seeing.

Quick reads (NetworkTables)

// Class name as a string (e.g., "note", "empty")
String className = LimelightHelpers.getClassifierClass("limelight");

// Class index (integer ID from the T2D array)
int classIndex = LimelightHelpers.getClassifierClassIndex("limelight");
getClassifierClass() reads from the tcclass NetworkTables key. getClassifierClassIndex() reads index 11 from the T2D array.

Full results via JSON

LimelightHelpers.LimelightResults results =
    LimelightHelpers.getLatestResults("limelight");

for (LimelightHelpers.LimelightTarget_Classifier c : results.targets_Classifier) {
    System.out.printf(
        "Class: %s (ID %d)  confidence=%.2f  zone=%.0f  tx=%.1f  ty=%.1f%n",
        c.className, (int) c.classID, c.confidence, c.zone, c.tx, c.ty
    );
}
Each LimelightTarget_Classifier contains:
FieldTypeDescription
classNameStringHuman-readable class name
classIDdoubleNumeric class ID
confidencedoubleClassification confidence (0–1)
zonedoubleZone index used for classification
txdoubleHorizontal offset in degrees
tydoubleVertical offset in degrees
tx_pixelsdoubleHorizontal offset in pixels
ty_pixelsdoubleVertical offset in pixels

Python scripting

You can run custom Python scripts on the Limelight and exchange data arrays over NetworkTables. This lets you implement advanced logic or custom processing without modifying robot code.
// Send data to the Python script running on the Limelight
// Up to 32 doubles in the outgoing array
double[] outgoing = { 1.0, 2.0, 3.0 };
LimelightHelpers.setPythonScriptData("limelight", outgoing);

// Read output from the Python script
double[] incoming = LimelightHelpers.getPythonScriptData("limelight");
if (incoming.length > 0) {
    System.out.println("Python output[0]: " + incoming[0]);
}
Data flows as double[] arrays over the llrobot (outgoing) and llpython (incoming) NetworkTables keys. The Python script reads from llrobot and writes to llpython.

Build docs developers (and LLMs) love