Skip to main content
API Reference SwiftyNsdk

NsdkVps2Session


Declaration

final class NsdkVps2Session

Methods

NameTypeSummary
anchorPayloadNsdkAsyncState<String, Never>?
Gets the payload data of a specified anchor.
The payload encodes the data needed to localize an anchor across multiple devices or sessions.
It can be shared or stored for later use with trackAnchor(payload:).
Payloads are only available after the anchor is tracked.
- Precondition: anchorId must be exactly 32 characters long.
- Parameter anchorId: The unique identifier of the anchor
- Returns: An AnchorTrackingBound representing the state of the anchor payload request:
- .inProgress(nil): The anchor is not yet tracked, so the payload is not yet available.
- .success(Value): The request completed successfully. Contains the base64-encoded payload.
- nil: No anchor with id anchorId was found.
anchorUpdateVpsAnchorUpdate?
Gets the latest tracking update for a specified anchor.
Call this regularly to get updated anchor poses as the device moves and VPS refines
the localization.
- Precondition: anchorId must be exactly 32 characters long.
- Parameter anchorId: The unique identifier of an anchor
- Returns: The anchor update, if it is available, nil if otherwise.
configurevoid
Configures the session with the specified settings.
- Attention: This method must be called while the session is stopped,
or configuration will fail. In that case, while this function returns without
throwing, configuration will still fail asynchronously. Use featureStatus()
to check that configuration has not failed.
- Parameter config: An object that defines this session's behavior.
Only settings that differ from the defaults will be applied.
- Throws: ArdkError.invalidArgument if the configuration is invalid.
Check ARDK's C logs for more information.
createAnchorNsdkVpsAnchorId
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.
- Parameter pose: The 4x4 transformation matrix representing the anchor's position and
orientation
- Returns: A unique identifier for the created anchor
featureStatusNsdkFeatureStatus
Reports errors that have occurred within processes running inside this feature.
Check this periodically to see if any errors have occurred with processes running
inside this feature. Once an error has been flagged, it will remain flagged until the
culprit process has been run again and completed successfully.
- Returns: Feature status flags for any issues that have occurred
getGeolocationVps2GeolocationData
Gets the geolocation of a pose using the provided VPS2 transformer.
- Parameters:
- transformer: The transformer to use for the geolocation calculation.
- pose: The pose in the device's AR coordinate space.
- Returns: Geolocation data corresponding to the given pose.
- Note: The function may succeed even if the transformer is not localized; callers should
check transformer.trackingState and treat results as invalid if it is .unavailable.
getLatestNetworkRequestRecords[Vps2NetworkRequestRecord]
Gets the latest network request records from the VPS2 feature.
- Returns: The network request state changes that have occurred since the last call to this function.
getLatestTransformerVps2Transformer
Gets a copy of the latest VPS2 transformer.
The returned transformer contains all data required to convert between
AR space and geolocation based on the most recent VPS2 localization.
If VPS2 has not yet localized, the transformer's trackingState will be
.unavailable, and the remaining fields should be considered invalid.
- Returns: The latest VPS2 transformer.
getPoseVps2Pose
Gets the AR pose corresponding to a geolocation using the provided VPS2 transformer.
- Parameters:
- transformer: The transformer to use for the pose calculation.
- location: The geolocation to convert into an AR pose.
- Returns: The pose in the device's AR coordinate space.
- Note: Callers should ensure transformer.trackingState != .unavailable before using the result.
removeAnchorBool
Request to stop tracking an anchor.
Once removed, the anchor will no longer receive updates or consume processing resources.
- Precondition: anchorId must be exactly 32 characters long.
- Parameter anchorId: The unique identifier of the anchor to remove
- Returns: True if the anchor was removed, false if otherwise
startvoid
Starts the VPS2 session.
This begings the process of collecting some local device sensor data that is needed for
localization. In order to actually localize, trackAnchor(payload:) must be called.
stopvoid
Stops the VPS2 session.
This halts all VPS2 processing and anchor tracking. The session can be
reconfigured and restarted after stopping.
trackAnchorNsdkVpsAnchorId
Requests to start tracking an anchor specified by a payload.
A VPS payload contains all the data needed to localize at a VPS-activated location.
A default payload for a VPS-activated location can be obtained from the "blob" field
in the details view of an entry in the Geospatial Browser, or via anchorPayload(anchorId:)
for user-generated anchors.
- Parameter payload: Base64-encoded anchor payload
- Returns: The unique identifier of the anchor encoded in the payload
- Throws: ArdkError.invalidArgument if the payload is not valid.

Nested Types

Structs

NameTypeSummary
ConfigurationConfiguration
Configuration for the VPS2 session.

Relationships

conforms to: NsdkFeatureSession