# SingleFrameLocalizationManager

#### Single Frame Localization Manager

The SingleFrameLocalizationManager is a specialized component within the MultiSet SDK designed to perform VPS localization using a single camera frame per request. This approach is useful for scenarios where quick, individual localization attempts are preferred over a continuous multi-frame approach. The manager can be configured to make multiple single-frame attempts and select the best result based on confidence scores.

#### **Description**

This manager handles the process of capturing a single, high-quality (non-blurry) image from the device's AR camera, sending it to the MultiSet backend for pose estimation, and then aligning the mapSpace GameObject with the real world. It includes features for automatic localization on startup, re-localization upon losing AR tracking, and a confidence-based validation system to ensure the reliability of the localization result. It provides UnityEvent callbacks for developers to respond to key moments in the localization lifecycle.

## P**roperties**

This section details the publicly accessible fields of the SingleFrameLocalizationManager that can be configured in the Unity Editor or through script.

| Property                 | Type             | Description                                                                                                                                                       |
| ------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| localizationType         | LocalizationType | An enum specifying whether to localize against a single Map or a MapSet.                                                                                          |
| mapOrMapsetCode          | string           | The unique code for the map or map set that the device will attempt to localize against. This is a required field.                                                |
| autoLocalize             | bool             | If true, the manager will automatically start the localization process after the SDK has successfully authenticated.                                              |
| relocalization           | bool             | If true, the manager will attempt to re-localize automatically if the AR session loses tracking.                                                                  |
| confidenceCheck          | bool             | When enabled, the manager will only consider a localization successful if its confidence score, returned by the API, is above the \_confidenceThreshold.          |
| \_confidenceThreshold    | float            | The minimum confidence score required for a localization result to be considered valid when confidenceCheck is enabled. The value is clamped between 0.2 and 0.8. |
| showAlert                | bool             | If true, a toast message will be displayed on the screen indicating whether the final localization result was a success or failure.                               |
| passGeoPose              | bool             | If enabled, the manager will include the device's GPS coordinates in the localization request to serve as a hint for the backend.                                 |
| geoCoordinatesInResponse | bool             | If enabled, the manager will request that the localization response includes the geo-coordinates corresponding to the device's estimated position.                |
| hintRadius               | int              | Search radius in meters for spatial filtering (default: 25m). The value is clamped between 1 and 100. Only applies when geoHint or hintPosition is provided.      |
| use2DFiltering           | bool             | When true, skip altitude (Y-axis) in geoHint spatial filtering. Uses only horizontal distance (X and Z axes). Only applies when geoHint is provided.              |
| LocalizationInit         | UnityEvent       | A UnityEvent that is invoked at the beginning of the localization process when LocalizeFrame() is called.                                                         |
| LocalizationSuccess      | UnityEvent       | A UnityEvent that is invoked after a successful localization attempt that meets the confidence criteria (if enabled), and the mapSpace pose has been updated.     |
| LocalizationFailure      | UnityEvent       | A UnityEvent that is invoked if all localization attempts fail to produce a valid pose or if the best result does not meet the confidence threshold.              |

***

#### **Public Methods**

This section describes the publicly accessible methods of the SingleFrameLocalizationManager.

**LocalizeFrame()**

Manually initiates the single-frame localization process.

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

**Description**\
Calling this method starts the localization sequence. The manager will attempt to capture a non-blurry image and send it to the MultiSet API. After the attempt is complete, it evaluates the result to find the best pose. This is the main method to use for triggering localization on demand.


---

# Agent Instructions: 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:

```
GET https://docs.multiset.ai/unity-sdk/api-reference/singleframelocalizationmanager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
