STRUCT
VpsAnchorUpdate
public struct VpsAnchorUpdate: CustomStringConvertible
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(anchorId:) 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 Usage
let (status, update) = vpsSession.getAnchorUpdate(anchorId: anchorId)
if status.isOk() {
print("Anchor ID: \(update.anchorId)")
print("Pose: \(update.anchorToLocalTransform)")
print("Tracking State: \(update.trackingState)")
print("Confidence: \(update.trackingConfidence)")
if update.trackingState == .tracked && update.trackingConfidence > 0.8 {
// Use anchor pose for AR content placement
placeARContent(at: update.anchorToLocalTransform)
}
}
Properties
anchorId
public var anchorId: ArdkVpsAnchorId
The unique identifier of the anchor.
anchorToLocalTransform
public var anchorToLocalTransform: simd_float4x4?
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.
trackingState
public var 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
public var 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.
trackingConfidence
public var 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.
timestampMs
public var timestampMs: UInt64?
Timestamp when this update was generated (in milliseconds since epoch).
description
public var description: String