> 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/documentation/understanding/results-json-vs-raw-networktables.md).

# Results JSON vs. Raw NetworkTables

YALL gives you two different paths to the same underlying camera data, and picking the right one for your use case matters for loop timing.

## The JSON path: `getLatestResults()`

`limelight.getLatestResults()` (equivalently `limelight.getData().getResults()`) reads the `json` NetworkTables entry and deserializes it with Jackson into a `LimelightResults` object: one object holding **everything** the Limelight published for that frame, including every target type array, hardware/IMU telemetry, every bot-pose variant, latency figures, and more.

This only works if the Limelight GUI's **Output & Crosshair → Send JSON over NT?** option is enabled. If it's off, `getLatestResults()` always returns `Optional.empty()`.

Reach for this when you need:

* Multiple target/pipeline types at once
* Hardware telemetry (`HardwareReport`, `IMUResults`, `RewindStats`, `HailoStats`)
* Barcode or retroreflective results (no raw-NT equivalent exists for these)

Cost: a full JSON parse on every call. Fine for most periodic loops, but avoid calling it more than once per loop iteration. Cache the `Optional<LimelightResults>` locally if multiple parts of your code need it in the same cycle.

## The raw path: `LimelightData` direct reads

`LimelightData` (from `limelight.getData()`) also exposes several values as direct NetworkTables reads, bypassing JSON entirely:

| Method                                        | Backing NT entry        |
| --------------------------------------------- | ----------------------- |
| `getRawFiducials()`                           | `rawfiducials`          |
| `getRawDetections()`                          | `rawdetections`         |
| `getBarcodeData()`                            | `rawbarcodes`           |
| `getCamera2Robot()`                           | `camerapose_robotspace` |
| `getClassifierClass()` / `getDetectorClass()` | `tcclass` / `tdclass`   |

`LimelightTargetData` (`limelight.getData().targetData`) goes further: `tx`, `ty`, target area, target count, and every relative pose (`robot2Target`, `camera2Target`, etc.) are all direct scalar/array NT reads, with no JSON involved at all.

Reach for these when:

* You only need tag/detection geometry, not the full frame
* You're polling every loop and want to avoid repeated JSON parsing
* You need bounding-box corners (`RawDetection`), which the JSON `NeuralDetector` result doesn't include

## Rule of thumb

Raw NetworkTables reads for tight, latency-sensitive loops (aiming, MegaTag pose fusion). JSON results when you need the full picture or a target type only the JSON exposes.

## See Also

* [How do I read raw fiducials and detections?](/documentation/how-to-guides/how-do-i-read-raw-fiducials-and-detections.md)
* LimelightData reference
* LimelightResults reference


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://yall.yassrobotics.com/documentation/understanding/results-json-vs-raw-networktables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
