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

AnchorUpdate


Declaration​

data class AnchorUpdate

Summary​

Contains the latest tracking information for a VPS anchor. AnchorUpdate provides comprehensive information about an anchor's current state, including its pose, tracking quality, and status information. This data is updated as VPS refines its localization.

Overview​

Anchor updates are retrieved via getAnchorUpdate(uuid) and provide the most current information about an anchor's position, orientation, and tracking status. The data includes confidence metrics and timestamps for quality assessment.

Example​

val update = vpsSession.getAnchorUpdate(anchorId)
println("Anchor ID: ${update.uuid}")
println("Pose: ${update.anchorToLocalTrackingTransform}")
println("Tracking State: ${update.trackingState}")
println("Confidence: ${update.trackingConfidence}")
if (update.trackingState == AnchorTrackingState.TRACKED && update.trackingConfidence > 0.8f) {
// Use anchor pose for AR content placement
placeARContent(update.anchorToLocalTrackingTransform)
}

Properties​

NameTypeSummary
anchorToLocalTrackingTransformPose
The 4x4 transformation matrix from anchor space to local tracking space.
This matrix represents the anchor's position and orientation relative to the
device's current local coordinate system. Use this for placing AR content
relative to the anchor.
geolocationGeolocationData?
Geolocation data of the anchor, or null if unavailable.
timestampMsLong
Timestamp when this update was generated (in milliseconds since epoch).
trackingConfidenceFloat
Confidence score for the current tracking estimate.
A value between 0.0 and 1.0 indicating the reliability of the pose estimate.
Higher values indicate more reliable tracking. Use this to determine whether
the pose data is suitable for your application.
trackingStateAnchorTrackingState
The current tracking state of the anchor.
Indicates whether the anchor is being tracked and how reliable the pose data is.
See [AnchorTrackingState] for detailed information about each state.
trackingStateReasonAnchorTrackingStateReason
Additional context about the tracking state.
Provides specific reasons for tracking issues or state changes, helping
applications understand and respond to tracking problems.
uuidUUID
The unique identifier of the anchor.