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

getAssetTrackingData


Declaration​

fun getAssetTrackingData(assetId: String? = null): Vps2AssetTrackingData?

Summary​

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 of
the 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.

Returns​

The asset's tracking data, or null when it has none yet.

Throws​

  • NsdkInvalidArgumentStatusException — if assetId is empty, or names an asset unknown to this session: assets become known as a localize request fetches them, so polling before the fetch completes can throw.