AnchorUpdate
Declaration
data class AnchorUpdateSummary
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)
}
Constructors
Constructor
constructor(uuid: ByteArray, anchorToLocalTrackingTransform: Pose, trackingStateValue: Int, trackingStateReasonValue: Int, trackingConfidence: Float, timestampMs: Long, geolocation: GeolocationData?)
Parameters
| Name | Type | Summary |
|---|---|---|
| uuid | ByteArray | - |
| anchorToLocalTrackingTransform | Pose | - |
| trackingStateValue | Int | - |
| trackingStateReasonValue | Int | - |
| trackingConfidence | Float | - |
| timestampMs | Long | - |
| geolocation | GeolocationData? | - |
Overload
constructor(uuid: UUID, anchorToLocalTrackingTransform: Pose, trackingState: AnchorTrackingState, trackingStateReason: AnchorTrackingStateReason, trackingConfidence: Float, timestampMs: Long, geolocation: GeolocationData? = null)
Parameters
| Name | Type | Summary |
|---|---|---|
| uuid | UUID | - |
| anchorToLocalTrackingTransform | Pose | - |
| trackingState | AnchorTrackingState | - |
| trackingStateReason | AnchorTrackingStateReason | - |
| trackingConfidence | Float | - |
| timestampMs | Long | - |
| geolocation | GeolocationData? | - |
Properties
| Name | Type | Summary |
|---|---|---|
| anchorToLocalTrackingTransform | Pose | The 4x4 transformation matrix from anchor space to local tracking space. This matrix represents the anchor's position and orientation in the device's AR tracking space (ARCore's coordinate convention), with translation in meters. It relates the anchor's origin to the tracking space origin and is independent of the current camera pose. Use this for placing AR content relative to the anchor. |
| geolocation | GeolocationData? | Geolocation data of the anchor, or null if unavailable. |
| timestampMs | Long | Timestamp when this update was generated (in milliseconds since epoch). |
| trackingConfidence | Float | 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. |
| trackingState | AnchorTrackingState | 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. |
| trackingStateReason | AnchorTrackingStateReason | Additional context about the tracking state. Provides specific reasons for tracking issues or state changes, helping applications understand and respond to tracking problems. |
| uuid | UUID | The unique identifier of the anchor. |