> For the complete documentation index, see [llms.txt](https://multiset.gitbook.io/multiset/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multiset.gitbook.io/multiset/unity-sdk/meta-quest/sample-scenes/single-frame-localization.md).

# Single Frame Localization

The [Single Frame Localization](/multiset/unity-sdk/meta-quest/api-reference/singleframelocalizationmanager.md) scene is a fundamental demonstration of how the platform performs localization within a mapped environment. It showcases the essential SDK prefabs, including the MultiSet SDK Manager which handles authentication, and the `SingleFrameLocalizationManager` which manages the localization process.

This scene uses a single camera frame to localize against the map, ideal for situations where you want a quick response from the localization API (roughly 2 seconds).

<figure><img src="/files/JqxcJr96QjO1UM1X6ITD" alt=""><figcaption></figcaption></figure>

### Core Components

The scene includes the following key GameObjects:

* **MultisetSdkManager**: Handles SDK authentication and initialization.
* **SingleFrameLocalizationManager**: Manages the single-frame localization process.
* **MapSpace**: Parent GameObject for all AR content anchored to the map.

### SingleFrameLocalizationManager Properties

| Property                        | Type               | Default | Description                                                                                                                 |
| ------------------------------- | ------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `localizationType`              | `LocalizationType` | `Map`   | Select whether to localize against a single Map or a MapSet.                                                                |
| `mapOrMapsetCode`               | `string`           | `""`    | The unique code for the map or mapSet to localize against.                                                                  |
| `queryMode`                     | `QueryMode`        | `Vps1`  | `Vps1` (Standard) is faster and suits most maps. `Vps2` (Deep Search) searches more broadly for large or repetitive spaces. |
| `autoLocalize`                  | `bool`             | `true`  | If true, localization starts automatically after SDK authentication.                                                        |
| `backgroundLocalization`        | `bool`             | `true`  | When enabled, the manager periodically re-localizes in the background to maintain positioning accuracy.                     |
| `bgLocalizationDuration`        | `float`            | `60`    | Time interval in seconds between background localization attempts. Valid range: **15–180 seconds**.                         |
| `confidenceCheck`               | `bool`             | `false` | When enabled, a result is accepted only if its confidence score exceeds the threshold.                                      |
| `_confidenceThreshold`          | `float`            | `0.3`   | Minimum confidence score required for a result to be valid when `confidenceCheck` is on. Valid range: **0.2–0.8**.          |
| `showAlert`                     | `bool`             | `true`  | If true, a toast message is displayed on success or failure.                                                                |
| `firstLocalizationUntilSuccess` | `bool`             | `true`  | When enabled, the first localization request retries silently until it succeeds without showing failure messages.           |

Localization hints (`hintMapCodes`, `hintPosition`, `hintFloorHeight`, `hintRadius`, `use2DFiltering`) can narrow the search further. These are set from script rather than the Inspector. See the [SingleFrameLocalizationManager](/multiset/unity-sdk/meta-quest/api-reference/singleframelocalizationmanager.md) reference for details.

### Localization Callbacks

| Callback                | Description                                                                       |
| ----------------------- | --------------------------------------------------------------------------------- |
| `LocalizationInit`      | Invoked when the localization process is initiated by calling `LocalizeFrame()`.  |
| `LocalizationRequested` | Invoked just before the captured frame is sent to the MultiSet API.               |
| `LocalizationSuccess`   | Invoked when the device has been successfully localized and the pose is applied.  |
| `LocalizationFailure`   | Invoked when the localization process fails (e.g., no pose found, network error). |

### Public Methods

**LocalizeFrame()**

Manually starts the single-frame localization process.

```csharp
public void LocalizeFrame()
```

Calling this method captures one frame from the Quest passthrough camera and sends it to the MultiSet backend for pose estimation. Use this if `autoLocalize` is disabled and you want to trigger localization manually. If a localization is already in progress, the call is ignored.

### Setup

1. Open the **SingleFrameLocalization** scene from the imported samples.
2. Select the **MultisetSdkManager** GameObject and configure your API credentials.
3. Select the **SingleFrameLocalizationManager** component and enter your **Map Code** or **MapSet Code**.
4. Add any AR content you want anchored to the map under the **MapSpace** GameObject.
5. Build and deploy to your Meta Quest device.

For the full property and method list, see the [SingleFrameLocalizationManager](/multiset/unity-sdk/meta-quest/api-reference/singleframelocalizationmanager.md) API 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://multiset.gitbook.io/multiset/unity-sdk/meta-quest/sample-scenes/single-frame-localization.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.
