Skip to main content

Niantic Spatial VPS2

Niantic Spatial’s Visual Positioning System 2 (VPS2), helps an app estimate where the device is in the world and place content at a stable position inside a mapped Site. It reports a geoposition as latitude, longitude, and altitude in a global coordinate system and a heading relative to geographic north.

VPS2 combines device sensors, visual data, and cloud services to estimate location and place content. When near a processed VPS map, VPS2 localizes against it to improve the accuracy of the device's geoposition and enable content placement in map-relative space.

What does VPS2 do?​

  1. The device runs local AR tracking.
  2. Optionally, VPS2 can use universal localization to establish a global geoposition and heading without requiring a VPS map.
  3. Alternatively, or in addition, the app can localize to a Site by its Site ID or to nearby Sites by coordinates. If the Site has a processed VPS map, VPS2 matches the camera view against the map. A successful match resolves a map-relative pose, reaches the precise tracking state, and reports the localized asset of the matching VPS map.
  4. The app reads the localized asset's tracking data to obtain an origin pose and confidence for content placement.
  5. The app can obtain the device's current geolocation and heading from VPS2 at any time. The VPS2 tracking state indicates the current localization quality. Separate accuracy values report the estimated horizontal, vertical, and rotational margins of error.

Localization modes​

VPS2 estimates the device's real-world position and heading using two modes, universal localization and VPS map localization. Enable each independently, on its own or together. VPS map localization is on by default; universal localization is off by default. Universal localization provides a global geoposition anywhere, and VPS map localization provides a precise geoposition when the device matches a Site's processed VPS map.

Universal localization​

Universal localization provides a global geoposition expressed as latitude, longitude, and altitude, along with a heading. Notably, it:

  • Works globally
  • Does not require a VPS map
  • Provides stable global alignment suitable for large-scale AR experiences

It operates through two methods:

Local Sensor Fusion​

This method fuses GPS and magnetometer data with device AR tracking locally on the device. It improves frame-to-frame stability beyond raw GPS and compass readings and is available globally without any cloud dependency.

Cloud-based Geopositioning​

When enabled, VPS2 sends camera imagery to the cloud to compute an improved geoposition and heading. This can provide greater accuracy than local sensor fusion alone. Improvements are most apparent in dense urban environments, where multipath effects and signal obstruction frequently degrade GPS accuracy. This is off by default; turn it on via the Universal Localization Enabled configuration option.

Cold start

In some regions, the first cloud geopositioning response may take 60 seconds or longer. Until this initial cloud response is received, global geoposition accuracy mirrors standard device GPS. This delay applies only to cloud-based coarse geopositioning. It does not affect VPS map localization once a VPS map is available and localization is attempted.

Cloud geopositioning defaults to 1 request per second, which is enough to determine a stable geoposition and heading in most conditions. Raising the rate can help the device work out where it is sooner, at the cost of bandwidth, battery, and CPU. See guidance on tuning request rates before changing it.

VPS map localization​

VPS map localization can be used when your application's user is within a Niantic VPS Site.

Unlike universal localization, which runs on its own once enabled, VPS map localization does not start automatically. Call ARVps2Manager.TryLocalize(siteId) to try localizing to a specific Site, or TryLocalize(latitude, longitude, radiusMeters) to try localizing to all nearby Sites.

Improved geopositioning​

Each VPS map is aligned to geographic coordinates in global space during processing. This alignment determines how poses in map-relative space convert to global latitude, longitude, altitude, and heading. Successful localization against a VPS map will likely improve the accuracy of NSDK's estimate of the user device's global position; however, this depends heavily on how precisely the VPS map is aligned to the real-world geographic coordinate system.

In Scaniverse Web, you can manually adjust maps with the Georeference tool to better align the VPS map with geographic imagery. This adjustment affects global geoposition accuracy but does not change local map-relative accuracy. The following points are important:

  • Satellite imagery is not guaranteed to be accurate and may be outdated.
  • Satellite images typically show rooftops, which may occlude or obscure ground-level geometry.
  • Indoor scans cannot always be precisely aligned to overhead imagery.
  • Tall buildings and shadows can reduce visual clarity in satellite imagery.
  • Rotation accuracy is critical. Small rotational misalignment between the VPS map and geographic north can produce increasing positional error as distance from the map origin increases. Positional offset remains constant, but rotational error is magnified as users move farther from the map center.

Assets​

When VPS2 localizes to a Site, it matches the camera view against the Site's VPS map, or asset. Virtual content can be placed relative to that asset's origin, and its accuracy depends on how well the asset is currently tracked. Refer to the guide on placing virtual content for how to get and interpret asset tracking data.

In Unity, tracked assets also surface as AR Foundation trackables: ARVps2Asset objects served by ARVps2AssetManager, whose transforms follow the asset's origin in Unity world space.

Asset tracking is separate from the device's geoposition:

  • Independent of the VPS2 tracking state. Asset tracking data reports the asset's origin pose in AR space; the device VPS2 tracking state reports the geoposition estimate. An asset can serve tracking data while the device tracking state is still coarse.
  • Failures surface as request records. When localization cannot proceed (permission denied, network issues), VPS2 reports it through the localization request records stream rather than through asset tracking data.

Whether the device is localized and whether an asset is tracked tells you if VPS2 is working as expected, but it does not explain why localization remains unavailable, is delayed, or appears inaccurate. If an asset never produces tracking data, localization takes longer than expected, or VPS2 reports an unexpected position, use VPS Debugger to inspect localization requests, response timing, camera frames, pose and gravity information, and geographic tracks from the session.

Tracking states​

VPS2 reports device localization separately from asset tracking. Do not use a device localization state of coarse or precise as proof that content is ready to place: localize to a Site, then wait until the localized asset supplies tracking data. See Place virtual content with VPS2.

ConceptAPI typeScopeValuesWhat it tells youUse it when
VPS2 tracking stateVps2TrackingStateSessionunavailable, coarse, preciseAnswers, "How well does the device know where it is in the world?" A quality category based on the VPS2 geoposition from GPS and cloud services; separate accuracy values give numeric margins of error.Placing content from geographic coordinates, or evaluating the device's geolocation and heading.
Asset trackingXRVps2AssetTrackingDataIndividual assetAvailable or unavailableWhen available, it provides the asset origin pose and confidence for reliable content placement. No data means the asset is not currently tracked.Deciding whether content can be reliably positioned relative to an asset's origin.

Next steps​

End-to-end guide:

Using VPS2 with the Niantic SDK: