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

createAnchor


Declaration​

fun createAnchor(pose: Pose): UUID

Summary​

Create and start tracking an anchor at the specified pose.


Anchors mark a place in the world that content should stay attached to. VPS2 must localize
to a map before anchors can be created for it — use localize with a site ID or its
lat/long overload. An anchor created here will only track with the asset of the site that
was active at the time of its creation.

Returns​

The anchor's unique id — an NSDK UUID (typealias UUID = ByteArray, a 32-byte ASCII uppercase-hex id, not java.util.UUID). Use anchorIdToString for a printable string.

Throws​

  • NsdkInvalidOperationStatusException — if the current localization tracking state is not Vps2TrackingState.PRECISE.

Parameters​

NameTypeSummary
posePose
-