> 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/pose-estimate.md).

# PoseEstimate

**Package:** `limelight.networktables`

A single 3D pose estimate read from one Limelight `botpose*` NetworkTables entry, along with the AprilTag observations that produced it. Instances come from [`LimelightPoseEstimator`](https://yall.yassrobotics.com/api-reference/java-reference/networktables/limelight-pose-estimator.md) or `BotPose.get(limelight)` — you generally don't construct these directly.

***

## Fields

| Field              | Type              | Description                                                     |
| ------------------ | ----------------- | --------------------------------------------------------------- |
| `pose`             | `Pose3d`          | Estimated robot pose.                                           |
| `timestampSeconds` | `double`          | NT server timestamp, adjusted for total latency, in seconds.    |
| `latency`          | `double`          | Total pipeline latency in milliseconds.                         |
| `tagCount`         | `int`             | Number of AprilTags used in this estimate.                      |
| `tagSpan`          | `double`          | Maximum distance between visible tags, in meters.               |
| `avgTagDist`       | `double`          | Average camera-to-tag distance, in meters.                      |
| `avgTagArea`       | `double`          | Average tag area as a percentage of the image.                  |
| `rawFiducials`     | `RawFiducial[]`   | Per-tag detail for every tag used in the estimate.              |
| `hasData`          | `boolean`         | `true` if the estimate contains at least one observed fiducial. |
| `isMegaTag2`       | `boolean` (final) | Whether this estimate came from the MegaTag2 pipeline.          |

***

## Methods

| Method                 | Returns                  | Description                                                                                      |
| ---------------------- | ------------------------ | ------------------------------------------------------------------------------------------------ |
| `getPoseEstimate()`    | `Optional<PoseEstimate>` | Re-reads the bound NT entry and repopulates this object's fields. Empty if no data is published. |
| `refresh()`            | `PoseEstimate`           | Calls `getPoseEstimate()` and returns `this` for chaining.                                       |
| `getMinTagAmbiguity()` | `double`                 | Minimum `ambiguity` across `rawFiducials`. Returns `1` if `hasData` is `false`.                  |
| `getMaxTagAmbiguity()` | `double`                 | Maximum `ambiguity` across `rawFiducials`. Returns `1` if `hasData` is `false`.                  |
| `getAvgTagAmbiguity()` | `double`                 | Average `ambiguity` across `rawFiducials`. Returns `1` if `hasData` is `false`.                  |

***

## Filtering Before Fusing

`avgTagDist`, `tagCount`, and the ambiguity helpers are the standard gate before calling `addVisionMeasurement` on a WPILib pose estimator — reject stale or unreliable reads instead of trusting every frame:

```java
visionEstimate.ifPresent(estimate -> {
    if (estimate.avgTagDist < 4 && estimate.tagCount > 0 && estimate.getMinTagAmbiguity() < 0.3) {
        poseEstimator.addVisionMeasurement(estimate.pose.toPose2d(), estimate.timestampSeconds);
    }
});
```

## See Also

* [LimelightPoseEstimator](https://yall.yassrobotics.com/api-reference/java-reference/networktables/limelight-pose-estimator.md)
* [RawFiducial](https://yall.yassrobotics.com/api-reference/java-reference/results-and-telemetry/raw-fiducial.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 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/api-reference/java-reference/networktables/pose-estimate.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.
