Skip to main content
API Reference com.nianticspatial.nsdk.vps2

Vps2Session

↳ extends SessionBase
A session for VPS2 localization.

Declaration

class Vps2Session

Properties

NameTypeSummary
anchorPollingIntervalMsLong
-
anchorUpdatesFlow<AnchorUpdate>
Flow of anchor updates for all tracked anchors. Anchors are automatically added when created via [trackAnchor] or [createAnchor].
ardkHandleLong
-
localizationPollingIntervalMsLong
-
localizationRequestRecordsFlow<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.
localizationUpdatesFlow<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

NameTypeSummary
anchorIdToStringString
Convert a VPS2 anchor id (32-byte ASCII hex) to a printable string.
configurevoid
Configure VPS2. Must be called while stopped.
createAnchorUUID
Create and start tracking an anchor at the specified pose.
featureStatusFeatureStatus
-
getAnchorPayloadString?
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].
getAnchorUpdateAnchorUpdate
Gets the latest tracking update for a specified anchor.
getDeviceGeolocationVps2GeolocationData?
Get the geolocation of the device's last known camera pose.
getLatestLocalizationVps2Localization
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.
getLatestLocalizationRequestRecordsList<Vps2LocalizationRequestRecord>
Get diagnostic localization request records since the last call.
getPosePose
Convert a geolocation to an AR pose using a localization snapshot.
getTrackedAnchorsSet<UUID>
Get the set of all tracked anchors.
onDestroyvoid
-
onInitvoid
-
removeAnchorvoid
Stop tracking an anchor.
startvoid
-
stopvoid
-
trackAnchorUUID
Start tracking an anchor specified by a base64 payload.