ARVps2Manager
↳ extends UnityEngine.XR.ARFoundation.SubsystemLifecycleManager
Declaration
public class ARVps2Manager : SubsystemLifecycleManager<XRVps2Subsystem, XRVps2SubsystemDescriptor, Provider>Summary
The entry point to VPS2: configuration, localization, geolocation, anchors, and asset tracking.
Remarks
This manager owns the VPS2 feature's lifecycle. The trackables are served by the ARVps2AnchorManager and ARVps2AssetManager components required next to it; the anchor and asset methods here forward to them.
Properties
| Name | Type | Summary |
|---|---|---|
| AerialLocalizationEnabled | bool | |
| AnchorDistanceGateMeters | float | Distance gate in meters for anchor candidate filtering when geo-corrected. Nodes farther than this distance from the device are skipped during anchor localization. When only GPS is available (no geo-correction), the effective gate is 2x this value. Pass 0 to use the default value (100 meters geo-corrected, 200 meters GPS-only). Pass -1 to disable the distance check entirely. |
| readonly AnchorManager | ARVps2AnchorManager | The trackable manager serving ARVps2Anchors. Required on the same GameObject. Added at runtime when missing, because RequireComponent only applies when this component is added in the editor, not when a scene saved without the manager loads. |
| AreaTargetingEnterMarginMeters | float | How far outside a VPS area's geographic bounds the device can be and still start localizing against that area, in meters. Covers ordinary GPS error, so a device standing just outside an area still picks it up. An area the server published no bounds for is always a candidate. 0 uses the default (25 meters); a negative value means no margin, judging the bounds exactly. |
| AreaTargetingExitMarginMeters | float | How far outside its bounds an area already being localized against is kept, in meters. Larger than AreaTargetingEnterMarginMeters on purpose: the gap between the two is what stops a device sitting on the boundary between two areas swapping between them on every position update. A value below the enter margin is raised to it. 0 uses the default (50 meters); a negative value means no margin. |
| readonly AssetManager | ARVps2AssetManager | The trackable manager serving ARVps2Assets. Required on the same GameObject. Added at runtime when missing, because RequireComponent only applies when this component is added in the editor, not when a scene saved without the manager loads. |
| BlurDetectionEnabled | bool | If true, enable the image blur check on the cloud localization path. Advisory only: a frame whose sharpness score is below MinSharpnessScore produces a FrameFlagged localization request record (error ImageTooBlurry) so the app can warn the user, but is still sent for localization, never rejected. Default false (disabled). |
| ContinuousVpsRequestsPerSecond | float | Number of VPS localization requests per second to send the server after the first successful localization on a VPS map. |
| DeviceMapLocalizationEnabled | bool | If true, localization on device maps is enabled. Device maps are created by the on-device mapping feature. They do not provide a georeference. |
| DeviceMapLocalizationFramerate | int | Number of times per second to attempt localization on available device maps. |
| GeolocationSmoothingEnabled | bool | If true, enables smooth interpolation between VPS2 localization updates. As VPS2 updates its estimate from one localization to another, having interpolation enabled will provide a more stable experience, especially when GPS or compass readings update abruptly. |
| InitialVpsRequestsPerSecond | float | Number of VPS localization requests per second to send the server prior to the first successful localization on a VPS map. |
| MaxRequestsInTransitPerTarget | uint | Maximum number of concurrent localization requests per target. Pass 0 to use the default value (2). |
| MinSharpnessScore | float | Sharpness threshold below which a frame is flagged as too blurry. Higher scores mean sharper images. The default 0 flags nothing, since the score is always non-negative. Only used when BlurDetectionEnabled is true. |
| TemporalFusionEnabled | bool | If true, successive VPS localizations are temporally fused. Fusion smooths the localization stream, at the cost of latency reacting to a genuine pose change. Enabled by default. |
| readonly trackables | TrackableCollection<ARVps2Anchor> | The anchors served by AnchorManager. |
| readonly trackablesChanged | UnityEvent<ARTrackablesChangedEventArgs<ARVps2Anchor>> | Invoked when anchors have changed: added, updated, or removed. Forwarded from AnchorManager. |
| UniversalLocalizationEnabled | bool | If true, enables cloud-based geopositioning: VPS2 sends camera imagery to the cloud to compute an improved geoposition and heading, beyond what local sensor fusion provides. Requires a network connection but no pre-scanned VPS maps. If false, geopositioning relies on local sensor fusion alone. |
| UniversalLocalizationRequestsPerSecond | float | Number of cloud geopositioning requests to send per second while UniversalLocalizationEnabled is true. |
| VpsDebuggerEnabled | bool | If true, enable the VPS Debugger, which will log VPS2 related internal events to diagnose VPS2 tracking behavior and issues. |
| VpsDebuggerSavingFrameImageEnabled | bool | If true (and VpsDebuggerEnabled), attach a 180x135 JPEG thumbnail of each camera frame submitted with a VPS map localization request to the VPS debugger data, adding roughly 3-5 KB per request. |
| VpsMapLocalizationEnabled | bool | If true, localization on VPS maps is enabled. VPS maps only exist in pre-scanned areas. Your device must be localized on a VPS map in order for VPS anchors to be placed with high accuracy. |
Methods
| Name | Type | Summary |
|---|---|---|
| GetSessionId | bool | Gets the session id, if one exists. |
| OnBeforeStart | void | - |
| OnDisable | void | - |
| RemoveAnchor | void | Stops tracking an anchor and destroys its trackable. Forwards to RemoveAnchor. |
| TryCreateAnchor | bool | Attempts to create a new anchor at localPose, in AR session space. Forwards to TryCreateAnchor. |
| TryGetAnchorPayload | bool | Gets the payload which encodes the anchor. Forwards to TryGetAnchorPayload. |
| TryGetAssetTrackingData | bool | Attempts to get the pose of a VPS asset's origin, in AR session space. |
| TryGetDeviceGeolocation | bool | Attempts to get the geolocation of the device's last known camera pose. |
| TryGetGeolocation | bool | Attempts to convert a pose in AR session space to a position and orientation in the global coordinate system, using the latest VPS2 localization. The inverse of TryGetPose. |
| TryGetLatestLocalization | bool | Attempts to get the latest VPS2 localization, which carries the data required to convert between the AR tracking space and geolocation. |
| TryGetPose | bool | Attempts to convert a position and orientation in the global coordinate system to a pose in AR session space, using the supplied localization snapshot. |
| TryLocalize | bool | Requests localization to a site, identified by its site ID. |
| TryStopLocalize | bool | Stops localizing against previously requested sites. |
| TryTrackAnchor | bool | Starts tracking the anchor encoded by anchorPayload. Forwards to TryTrackAnchor. |
| TryTrackAsset | bool | Requests tracking of a VPS map asset's origin, identified by its asset ID. Forwards to TryTrackAsset. |
Events
| Name | Type | Summary |
|---|---|---|
| DebuggerDataReceived | Action<VpsDebuggerDataEvent> | Invoked for each VPS Debugger event while VpsDebuggerEnabled is true. |
| LocalizationRequestRecordAdded | Action<XRVps2LocalizationRequestRecord> | Invoked for each new localization request record: the outcome of a network request or frame submission made by VPS2. |
Relationships
derived: ARLocationManager
drone or other aerial capture. Requires UniversalLocalizationEnabled.
There is currently no way to query aerial coverage; contact Niantic Spatial for
details. Disabled by default.