Skip to main content

Placing Virtual Content with VPS2

Anchors are persistent spatial reference points that can be tracked across sessions and devices. The VPS2 session is responsible for managing these anchors and correlating them with their real-world geographic locations.

Prerequisites

This guide assumes that you’ve already gone through:

Creating Anchors

Getting Anchor Payloads

The payload encodes the data needed to localize an anchor across multiple devices or sessions. It is a base64-encoded string that can be shared or stored and is only available after the anchor has been tracked and can be obtained from:

  1. Default anchors of published Sites: the "Anchor Payload" field in the Sites Asset view

Updating anchors

Once an anchor has been added via either the createAnchor or trackAnchor functions, your application should query for its update.

Anchor updates also surface a tracking state which can be "not tracked", "limited", or "tracked." Once an anchor exits the "not tracked" state, the update will also have a valid pose for the anchor in local AR space.

In addition to the tracking state, VPS2 anchor updates will have a type of either "coarse" or "refined" (anchor updates in the original VPS were only of "refined" type). VPS2 will attempt to provide coarse updates for all anchors, while refined updates are only available when the device has localized to the map the anchor was created on.

It is best practice to:

  1. Wait for the anchor state to be "tracked".
  2. Branch application behaviour on whether the anchor update is "coarse" or "refined."
note

In version NSDK 4.0 beta 1, while an anchor with a "refined" update type will have centimer-level accuracy relative to your device, the geolocation of that anchor is heavily affected by:

  1. Whether the map the anchor is located on has been manually aligned.
  2. If the map was not manually aligned, the current quality of VPS2's georeference estimate for your device.

Hence, when tracking anchors on maps that have not been manually aligned, you may see the geolocation of an anchor jump to your device's estimated geolocation when the anchor update type goes from "coarse" to "refined."

Removing Anchors

Once removed, the anchor will no longer receive updates or consume processing resources.