map-location-dotLocalization

Localization scene demonstrates multi-frame map localization using the Quest SDK's MapLocalizationManager. This scene captures multiple camera frames to localize the device against a pre-existing 3D map or map set, providing higher accuracy compared to single-frame localization at the cost of slightly longer capture time.

This scene uses multiple camera frames (4–6) to localize against the map, ideal for situations where accuracy is prioritized over speed.

Core Components

The scene includes the following key GameObjects:

  • MultisetSdkManager — Handles SDK authentication and initialization.

  • MapLocalizationManager — Manages the multi-frame localization process.

  • MapSpace — Parent GameObject for all AR content anchored to the map.

MapLocalizationManager 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 map set to localize against.

autoLocalize

bool

true

If true, localization starts automatically after SDK authentication.

backgroundLocalization

bool

true

When enabled, the manager periodically sends localization requests in the background to maintain positioning accuracy.

bgLocalizationDuration

float

60

Time interval in seconds between background localization attempts. Valid range: 15–180 seconds.

numberOfFrames

int

4

Number of camera frames to capture per localization request. More frames improve accuracy but increase capture time. Valid range: 4–6 frames.

frameCaptureInterval

float

0.3

Time delay in seconds between capturing each frame. Valid range: 0.4–0.8 seconds.

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 Callbacks

Callback
Description

LocalizationInit

Invoked when the localization process is initiated by calling LocalizeFrame().

LocalizationRequested

Invoked just before captured frames are 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 multi-frame localization process.

Calling this method begins capturing the specified numberOfFrames from the Quest passthrough camera. Once the frames are collected, they are sent to the MultiSet backend to request localization. Use this if autoLocalize is disabled and you want to trigger localization manually.

Setup

  1. Open the Localization scene from the imported samples.

  2. Select the MultisetSdkManager GameObject and configure your API credentials.

  3. Select the MapLocalizationManager component and enter your Map Code or MapSet Code.

  4. Adjust frame capture settings (numberOfFrames, frameCaptureInterval) based on your environment.

  5. Build and deploy to your Meta Quest device.

Last updated