CLASS
ArdkWpsSession
public final class ArdkWpsSession: ArdkSession.IDisposable
A session for World Positioning System (WPS) functionality.
WPS provides the 3D position and orientation of the device in geographic coordinates as an alternative to using device GPS and compass heading data. WPS provides greater accuracy and frame-to-frame stability than standard GPS positioning, making it more suitable for AR applications. As the user moves around, WPS maintains the device's position, making it suitable for continuous use over long periods of time and long distances. WPS will work in any location where the phone has a GPS signal, but the accuracy will vary depending on GPS accuracy.
Methods
featureStatus()
public func featureStatus() -> ArdkFeatureStatus
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
Example
let status = wpsSession.getFeatureStatus()
if !status.isOk() {
print("WPS has encountered an error")
}
configure(with:)
public func configure(with config: Configuration) throws
Configures the session with the specified settings.
- Attention: This method must be called while the session is stopped,
or else 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.invalidArgumentif the configuration is invalid. Check ARDK's C logs for more information.
Parameters
| Name | Description |
|---|---|
| config | An object that defines this session’s behavior. Only settings that differ from the defaults will be applied. |
start()
public func start()
Starts the WPS system.
This begings the process of collecting some local device sensor data that is needed for localization.
stop()
public func stop()
Stops the WPS system.
This halts all WPS processing. The session can be reconfigured and restarted after stopping.
latestLocation()
public func latestLocation() -> Result<WpsLocation, WpsError>
Gets the transform of the latest geolocation estimate.
This exposes the low level data that can be used to pin geolocated content into the AR
coordinate system. To retrieve simplified device specific coordinates and heading, see
devicePoseAsGeolocation(_:).
- Note: An
ArdkError.invalidOperationif the session is not started. - Returns: The location transform, if available, or an error code otherwise.
devicePoseAsGeolocation(pose:)
public func devicePoseAsGeolocation(pose: simd_float4x4) -> Result<GeolocationData, WpsError>
Use WPS to get an estimated geolocation for a pose in AR space.
- Parameter pose: A pose in the device's AR space.
- Returns: The estimated geolocation, if available, or an error code otherwise.
Parameters
| Name | Description |
|---|---|
| pose | A pose in the device’s AR space. |