Declaration
class Vps2SessionProperties
| Name | Type | Summary |
|---|---|---|
| anchorPollingIntervalMs | Long | - |
| anchorUpdates | Flow<AnchorUpdate> | Flow of anchor updates for all tracked anchors. Anchors are automatically added when created via [trackAnchor] or [createAnchor]. |
| ardkHandle | Long | - |
| debuggerEvents | Flow<VpsDebuggerDataEvent> | Flow of VPS debugger events. Each emission is a single [VpsDebuggerDataEvent] from the latest delta batch. Events are emitted only when new ones are available. Enable logging via [Vps2Config.enableVpsDebugger] before starting the session. |
| localizationPollingIntervalMs | Long | - |
| localizationRequestRecords | Flow<Vps2LocalizationRequestRecord> | Flow of localization request records. Each emission is a single [Vps2LocalizationRequestRecord] from the latest batch. Records are emitted only when new ones are available. |
| localizationUpdates | Flow<Vps2Localization> | Flow of the latest localization snapshot. This is useful for consumers that want to reactively drive UI or downstream computations without manually polling [getLatestLocalization]. |
Functions
| Name | Type | Summary |
|---|---|---|
| anchorIdToString | String | Convert a VPS2 anchor id (32-byte ASCII hex) to a printable string. |
| configure | void | Configure VPS2. Must be called while stopped. |
| createAnchor | UUID | Create and start tracking an anchor at the specified pose. |
| featureStatus | FeatureStatus | - |
| getAnchorPayload | String? | Gets the payload data of a specified anchor. The payload encodes the data needed to localize an anchor across multiple devices or sessions. It can be shared or stored for later use with [trackAnchor]. |
| getAnchorUpdate | AnchorUpdate | Gets the latest tracking update for a specified anchor. |
| getAssetTrackingData | Vps2AssetTrackingData? | Gets the pose and tracking confidence of a VPS asset's origin in the device's AR tracking space. Call this regularly to place content authored in the asset's coordinate space: the pose is refined as the device moves and VPS relocalizes. Tracking starts on demand and may take time to spin up, so keep polling. Data is only served while the asset is fully tracked — no localization, limited, and lost all return null, and content should not be placed in any of those states. This is independent ofthe VPS2 tracking state, which describes the geolocation estimate: an asset with no georeference serves tracking data while the tracking state stays coarse. This function only accepts a VPS map asset ID, not a mesh or splat asset ID. |
| getDeviceGeolocation | Vps2GeolocationData? | Get the geolocation of the device's last known camera pose. |
| getLatestDebuggerEvents | List<VpsDebuggerDataEvent> | Get VPS debugger events since the last call. |
| getLatestLocalization | Vps2Localization | Gets the most recent VPS2 localization result. The returned localization contains the spatial mapping between the device's AR coordinate space and real-world geolocation. |
| getLatestLocalizationRequestRecords | List<Vps2LocalizationRequestRecord> | Get diagnostic localization request records since the last call. |
| getPose | Pose | Convert a geolocation to an AR pose using a localization snapshot. In most cases you want the overload that uses the latest localization automatically; use this one only when a batch of geolocations must share a single snapshot. |
| getTrackedAnchors | Set<UUID> | Get the set of all tracked anchors. |
| insertCustomDebuggerEvent | void | Insert a custom event into the VPS debugger log. |
| localize | void | Requests localization to a site, identified by its site ID. Localizes against the site's production-deployed VPS assets and only those: an asset that has not been deployed to production cannot be localized against. This is an asynchronous operation: progress is reported on [localizationRequestRecords] as a record of type [Vps2LocalizationRequestType.ASSET_INFO] — [Vps2LocalizationRequestStatus.PENDING] on dispatch, then [Vps2LocalizationRequestStatus.COMPLETED], or [Vps2LocalizationRequestStatus.FAILED] with the record's error set (e.g. [Vps2LocalizationError.SITE_NOT_FOUND] when no such site exists, or [Vps2LocalizationError.ASSETS_NOT_FOUND] when the site has nothing localizable in it). COMPLETED means every production-deployed asset in the site was submitted forlocalization, not that localization succeeded — observe [localizationUpdates] for the outcome. Requests are additive: calling this again does not disturb a request already in flight, and the sites accumulate. Each request produces its own records, but the caller is not given its record identifier, so records from concurrent requests are distinguishable only by the order in which they arrive. May be called before [start]; requests are deferred and dispatched in order when VPS2 starts. Note: assets already submitted for localization remain in the localization set for the lifetime of the session. There is no way to stop localizing against a site once its assets have been submitted, and no way to cancel a request in progress. Each additional site permanently increases the size of every cloud localization request and the per-frame target-selection cost, so keep the number of sites small. |
| onDestroy | void | - |
| onInit | void | - |
| removeAnchor | void | Stop tracking an anchor. |
| start | void | - |
| stop | void | - |
| trackAnchor | UUID | Start tracking an anchor specified by a base64 payload. |