Skip to main content
API Reference SwiftyNsdk

NsdkWpsSession

A session for World Positioning System (WPS) functionality....

Declaration

final class NsdkWpsSession

Summary

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

NameTypeSummary
configurevoid
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: NsdkError.invalidArgument if the configuration is invalid.
Check NSDK's C logs for more information.
devicePoseAsGeolocationResult<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.
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
## Example
let status = wpsSession.getFeatureStatus()
if !status.isOk() {
print("WPS has encountered an error")
}
latestLocationResult<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 NsdkError.invalidOperation if the session is not started.
- Returns: The location transform, if available, or an error code otherwise.
startvoid
Starts the WPS system.
This begings the process of collecting some local device sensor data that is needed for
localization.
stopvoid
Stops the WPS system.
This halts all WPS processing. The session can be reconfigured and restarted after
stopping.

Nested Types

Structs

NameTypeSummary
ConfigurationConfiguration
Configuration structure for the WPS session.