> For the complete documentation index, see [llms.txt](https://yall.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yall.yassrobotics.com/api-reference/java-reference/networktables/limelight-target-data.md).

# LimelightTargetData

**Package:** `limelight.networktables`

2D and 3D per-target metrics for the currently tracked target, accessed via `limelight.getData().targetData`. Reflects whatever pipeline is active — retroreflective, AprilTag, classifier, or detector.

***

## Methods

| Method                               | Returns                | Description                                                                                                                                                                                                                                                                                |
| ------------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `getTargetStatus()`                  | `boolean`              | `true` if a valid target is present (`tv`). Check this before trusting `tx`/`ty`/etc.                                                                                                                                                                                                      |
| `getHorizontalOffset()`              | `double`               | Crosshair-relative horizontal offset in degrees (`tx`).                                                                                                                                                                                                                                    |
| `getVerticalOffset()`                | `double`               | Crosshair-relative vertical offset in degrees (`ty`).                                                                                                                                                                                                                                      |
| `getHorizontalOffsetFromPrincipal()` | `double`               | Principal-pixel-relative horizontal offset in degrees (`txnc`). More accurate than `tx` on a calibrated camera when adjustable crosshair isn't needed.                                                                                                                                     |
| `getVerticalOffsetFromPrincipal()`   | `double`               | Principal-pixel-relative vertical offset in degrees (`tync`).                                                                                                                                                                                                                              |
| `getTargetArea()`                    | `double`               | Target area as a percentage of the image, 0-100 (`ta`).                                                                                                                                                                                                                                    |
| `getTargetCount()`                   | `int`                  | Number of currently detected targets, decoded from the `t2d` metrics array.                                                                                                                                                                                                                |
| `getAprilTagID()`                    | `double`               | Current fiducial ID (`tid`).                                                                                                                                                                                                                                                               |
| `getNeuralClassID()`                 | `String`               | Current neural class name (`tclass`).                                                                                                                                                                                                                                                      |
| `getClassifierClassIndex()`          | `int`                  | Classifier class index, decoded from `t2d`.                                                                                                                                                                                                                                                |
| `getDetectorClassIndex()`            | `int`                  | Primary detector class index, decoded from `t2d`.                                                                                                                                                                                                                                          |
| `getTargetColor()`                   | `double[]`             | Target color in HSV/RGB format (`tc`).                                                                                                                                                                                                                                                     |
| `getTargetMetrics()`                 | `double[]`             | Raw `t2d` array: `[targetValid, targetCount, targetLatency, captureLatency, tx, ty, txnc, tync, ta, tid, targetClassIndexDetector, targetClassIndexClassifier, targetLongSidePixels, targetShortSidePixels, targetHorizontalExtentPixels, targetVerticalExtentPixels, targetSkewDegrees]`. |
| `getStandardDeviations()`            | `Pair<Pose3d, Pose3d>` | MegaTag1/MegaTag2 standard deviations as `Pair.of(MT1, MT2)`, decoded from `stddevs`.                                                                                                                                                                                                      |
| `getRobotToTarget()`                 | `Pose3d`               | Robot pose relative to the target (`botpose_targetspace`).                                                                                                                                                                                                                                 |
| `getCameraToTarget()`                | `Pose3d`               | Camera pose relative to the target (`camerapose_targetspace`).                                                                                                                                                                                                                             |
| `getTargetToCamera()`                | `Pose3d`               | Target pose relative to the camera (`targetpose_cameraspace`).                                                                                                                                                                                                                             |
| `getTargetToRobot()`                 | `Pose3d`               | Target pose relative to the robot (`targetpose_robotspace`).                                                                                                                                                                                                                               |

## See Also

* [LimelightData](/api-reference/java-reference/networktables/limelight-data.md)
* [LimelightResults](/api-reference/java-reference/networktables/limelight-results.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://yall.yassrobotics.com/api-reference/java-reference/networktables/limelight-target-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
