> 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/how-to-guides/how-do-i-take-snapshots-and-rewind-captures.md).

# How do I take snapshots and rewind captures?

## Snapshots (all hardware)

Asynchronously requests the Limelight to save a still image, without blocking the robot loop:

```java
limelight.snapshot("auto-align-attempt");
```

Pass `null` or `""` to let the Limelight auto-name the snapshot. This runs on a background thread via `CompletableFuture` — safe to call from a periodic loop, though it's typically triggered from a button or a one-shot event rather than every cycle.

## Rewind capture (supported hardware only)

Rewind saves a rolling video buffer you can flush to disk on demand — useful for post-match diagnosis of a missed vision read. Enable recording, then trigger a capture:

```java
limelight.getSettings().withRewindEnable(RewindState.ENABLED).save();

// Later, e.g. bound to a driver button after a suspicious auto-align:
limelight.rewindCapture(10); // capture the last 10 seconds, max 165
```

Capture requests are rate-limited to once every 2 seconds on the Limelight and are dropped if a flush is already in progress.

## Checking rewind buffer status

```java
limelight.getLatestResults().ifPresent(result -> {
    if (result.rewindStats != null) {
        boolean isFull = result.rewindStats.bufferUsage >= 1.0;
        double secondsStored = result.rewindStats.storedSeconds;
    }
});
```

## See Also

* Limelight#rewindCapture
* RewindStats 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 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/documentation/how-to-guides/how-do-i-take-snapshots-and-rewind-captures.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.
