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 the app localizes to a Site with a processed VPS map, VPS2 localizes against that map to improve the accuracy of the device's geoposition and enable content placement in map-relative space.
What does VPS2 do?
- The device runs local AR tracking, and VPS2 fuses it with GPS and, when available, compass readings into a coarse global geoposition and heading.
- Optionally, universal localization improves that geoposition with cloud geopositioning, without requiring a VPS map.
- 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 and reports the localized asset of the matching VPS map. Using the map's georeference, the match also raises the VPS2 tracking state to
precisefor as long as the map stays connected to the device's AR tracking. - The app reads the localized asset's tracking data to obtain an origin pose and confidence for content placement.
- 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 always runs local sensor fusion on the device. On top of that, it 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.
| Source | Needs | Configuration | Best VPS2 tracking state |
|---|---|---|---|
| Local sensor fusion | A GPS fix and AR tracking; a compass improves heading | Always on | coarse |
| Universal localization (cloud geopositioning) | Network connection and a GPS fix | Universal Localization Enabled, off by default | coarse |
| VPS map localization | A localize call and a Site with a processed VPS map | VPS Map Localization Enabled, on by default | precise, as accurate as the map's georeference |
Local sensor fusion
VPS2 fuses GPS data, and magnetometer data when the device has a compass, with device AR tracking locally on the device. This improves frame-to-frame stability beyond raw GPS and compass readings and is available globally without any cloud dependency. It runs whenever VPS2 is running and cannot be turned off, so a coarse geoposition is available with a GPS fix and normal AR tracking, even when universal localization is disabled.
Universal localization
Universal localization improves the device's 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
Neither universal localization nor local sensor fusion raises the VPS2 tracking state above coarse; only localizing to a VPS map reaches precise.
When enabled, universal localization uses cloud-based geopositioning: VPS2 sends camera imagery, along with the device's GPS position as a prior, 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. Requests are not sent without a GPS fix; such frames produce a NoValidPrior localization request record instead. This is what the Universal Localization Enabled configuration option turns on; it is off by default.
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.
Call ARVps2Manager.TryLocalize(siteId) to try localizing to a specific Site, or TryLocalize(latitude, longitude, radiusMeters) to try localizing to all nearby Sites.
In Unity, the ARVps2Manager component lifecycle governs VPS2: the session runs while the manager is enabled, and a TryLocalize(...) call made while it is disabled is rejected and returns false.
Improved geopositioning
Each VPS map is georeferenced during processing: it is aligned to geographic coordinates in global space. This alignment determines how poses in map-relative space convert to global latitude, longitude, altitude, and heading.
When the device localizes to a VPS map, VPS2 uses the map's georeference to raise the VPS2 tracking state to precise and to compute the device's geoposition. The reported geoposition, and any content placed from geographic coordinates, is therefore only as accurate as the georeference. Content placed relative to the map does not depend on it.
Before relying on geographic coordinates at a Site, verify its georeference in Scaniverse Web and adjust it if needed, as described below.
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 VPS2 tracking state is still
coarse, and the VPS2 tracking state can beprecisewhile an asset serves no data. - Served only from successful visual localization. An asset serves tracking data only while its VPS map is connected to the device's current AR tracking through successful visual localization. GPS, compass, and universal localization never produce asset tracking data.
- Confidence can rise and fall. Each localization against the asset updates its pose. The tracking confidence estimates how likely that pose is to be correct. With Temporal Fusion Enabled (the default), VPS2 fuses successive localizations, so confidence rises as they agree, and falls as they disagree or grow stale while the device moves. If it falls too low, the asset stops serving data.
- 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 its tracking state separately from asset tracking. Do not use a VPS2 tracking 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.
| Concept | API type | Scope | Values | What it tells you | Use it when |
|---|---|---|---|---|---|
| VPS2 tracking state | Vps2TrackingState | Session | unavailable, coarse, precise | Answers, "How well does the device know where it is in the world?" unavailable means no geoposition, either not yet or no longer (for example, after losing GPS with no VPS map correction). coarse comes from local sensor fusion and, if enabled, universal localization. precise requires localizing to a VPS map and is as accurate as the map's georeference; it falls back to coarse or unavailable if the device loses its connection to that map, for example when AR tracking resets. Separate accuracy values give numeric margins of error. | Placing content from geographic coordinates, or evaluating the device's geolocation and heading. |
| Asset tracking | XRVps2AssetTrackingData | Individual asset | Available or unavailable, plus a tracking confidence (Confidence) from 0.0 to 1.0 | When available, it provides the asset origin pose and a tracking confidence that estimates how likely that pose is to be correct. 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: