Skip to main content

ARDK for Android/com.nianticlabs.ardk.vps/VPSSession/createAnchor

createAnchor

[androidJvm]
fun createAnchor(pose: Pose): UUID

Requests to create an anchor at the specified pose. This will create an anchor relative to the currently tracked location that can be used to localize in future sessions.

Attention: This method requires that the session has successfully localized (an anchor was successfully tracked) before it returns a valid anchor payload for future sessions.

After creating an anchor, regularly poll getAnchorUpdate to get the anchor's updated pose.

Return​

A unique identifier for the created anchor

Parameters​

androidJvm

poseThe 4x4 transformation matrix representing the anchor's position and orientation

See also​

VPSSession.trackAnchor
VPSSession.removeAnchor

Throws​

ARDKStatusException with code ARDKStatus.invalidArgument if the pose is not a valid matrix.