Skip to main content
Version: Release 4.0.0

Getting Geoposition with VPS2

Prerequisites

This guide assumes that you have already completed:

Accessing Geoposition Estimates

VPS2 provides geoposition via an XRVps2Transformer. Retrieve the latest transformer and use it to convert between local AR tracking coordinates and global geoposition (latitude/longitude/altitude/heading).

if (vps2Manager.TryGetLatestTransformer(out var transformer)) {
// Your processing logic here
}
note

The transformer is a point-in-time snapshot. Updates to VPS2’s estimate are not reflected in previously retrieved transformer instances. To use the most recent estimate, fetch the latest transformer again.

Pose ↔ Geoposition

The transformer is a snapshot of VPS2’s current best estimate of the alignment between the application’s AR tracking space and the real world. It contains the metadata required to perform bidirectional conversions:

  • Pose → Geoposition: Provide a transformer and a pose (for example, the device pose or any pose in AR space) to compute latitude, longitude, altitude, and heading.
if (vps2Manager.TryGetGeolocation(transformer, pose, out var geolocation)) {
// ...
}
  • Geoposition → Pose: Provide a transformer and a geoposition (latitude, longitude, altitude, and heading) to compute a pose in AR space, enabling placement of latitude/longitude/altitude-authored content in AR.
if (vps2Manager.TryGetPose(transformer, latitude, longitude, altitude, orientation, out var pose)) {
// ...
}

Accuracy

The VPS2 transformer contains a tracking state that can be Unavailable, Coarse, or Precise. These are broad categories describing the quality of VPS2's georeference estimate.

Each estimate also includes accuracy values that represent margin-of-error estimates. Accuracy may vary across conversions performed with the same transformer when using different input poses or locations.

  • Horizontal accuracy (meters)
  • Vertical accuracy (meters)
  • Heading / rotation accuracy (degrees)
Attention

As of NSDK 4.0 Beta, VPS2 tends to overestimate margin-of-error values.