Features — LeonardoXR SDK

Features — LeonardoXR SDK

Features — LeonardoXR SDK

Version: 1.0.2 Target Device: Youbiquo Leonardo XR
Base SDK: Snapdragon Spaces 1.0.4

This page documents the features available in the LeonardoXR SDK, organized into two sections:

  • Snapdragon Spaces Features — AR/XR features provided by the Snapdragon Spaces platform and accessible via AR Foundation.
  • LeonardoXR Features — proprietary features specific to Leonardo XR.

Snapdragon Spaces Features

Local Anchors

How to Enable

Navigate to Project Settings > XR Plug-in Management > OpenXR (Android tab) > OpenXR Feature Groups > Snapdragon Spaces > Spatial Anchors and enable the feature.

Spaces Anchor Store (Script)

Warning: Look around the environment to generate a better tracking map and reduce save/load times. Saving multiple anchors simultaneously blocks the main thread — use the callback to save anchors sequentially.

This component requires an AR Anchor Manager (automatically added if missing). Add Spaces Anchor Store together with AR Anchor Manager to save anchors locally for future sessions.

namespace Qualcomm.Snapdragon.Spaces
{
    public class SpacesAnchorStore
    {
        public void ClearStore();

        public void SaveAnchor(ARAnchor anchor, string anchorName, Action<bool> onSavedCallback = null);
        public void SaveAnchor(ARAnchor anchor, Action<bool> onSavedCallback = null);
        public void SaveAnchorWithResult(ARAnchor anchor, string anchorName, Action<SaveAnchorResult> onSavedCallback = null);
        public void SaveAnchorWithResult(ARAnchor anchor, Action<SaveAnchorResult> onSavedCallback = null);

        public void DeleteSavedAnchor(string anchorName);

        public void LoadSavedAnchor(string anchorName, Action<bool> onLoadedCallback = null);
        public void LoadAllSavedAnchors(Action<bool> onLoadedCallback = null);

        public string[] GetSavedAnchorNames();
        public string GetSavedAnchorNameFromARAnchor(ARAnchor anchor);
    }
}
API Reference
Method Description
ClearStore() Clears the local anchor storage.
SaveAnchor(...) Saves an ARAnchor by name or generated hash; optional callback on completion.
SaveAnchorWithResult(...) Like SaveAnchor but returns a SaveAnchorResult enum.
DeleteSavedAnchor(name) Deletes a saved anchor by name.
LoadSavedAnchor(name, ...) Loads an anchor from storage and attempts to localize it; fires ARAnchorManager.anchorsChanged.added.
LoadAllSavedAnchors(...) Loads all stored anchors.
GetSavedAnchorNames() Returns all saved anchor names.
GetSavedAnchorNameFromARAnchor(anchor) Returns the name of a saved anchor from a tracked ARAnchor, or an empty string if not saved.
Values of SaveAnchorResult
Value Meaning
PENDING The anchor is pending saving.
SAVED Saved successfully.
FAILURE_RUNTIME_ERROR Runtime error.
FAILURE_STORE_NOT_LOADED The anchor store failed to load.
FAILURE_INSUFFICIENT_QUALITY Environmental map quality is insufficient.

Hit Testing

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Hit Testing.

Uses AR Foundation’s AR Raycast Manager (XRRaycastSubsystem). Supports continuous hit testing against real-world planes and meshes.

How it works: The system casts a ray from the camera (or a specified point) and returns intersections with surfaces detected in the environment. Each hit contains position, normal, and surface type (plane or mesh).

Typical usage:

// Add ARRaycastManager to the scene via XR Origin
// Then perform the raycast:
List<ARRaycastHit> hits = new List<ARRaycastHit>();
if (raycastManager.Raycast(screenCenter, hits, TrackableType.PlaneWithinPolygon))
{
    Pose hitPose = hits[0].pose;
    // Position AR content at hitPose.position
}

Known Issue: ARRaycastHit.trackableId always returns 0-0.


Image Tracking

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Image Tracking.

Uses AR Foundation’s AR Tracked Image Manager (XRImageTrackingSubsystem). Supports static and mutable (runtime) reference image libraries. Optional tracking modes control the computation frequency.

Static image library: configured in the Inspector via an XRReferenceImageLibrary asset. Images are compiled into the build.

Mutable library: use MutableRuntimeReferenceImageLibrary to add images at runtime:

var library = trackedImageManager.CreateRuntimeLibrary() as MutableRuntimeReferenceImageLibrary;
await library.ScheduleAddImageWithValidationJob(texture, "image-name", 0.1f); // 0.1f = physical width in meters
trackedImageManager.referenceLibrary = library;

Plane Detection

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Plane Detection.

Use AR Foundation’s AR Plane Manager (XRPlaneSubsystem). The Use Scene Understanding Backend option is enabled by default. Supports detection modes to control behavior. Convex hull planes can be enabled or disabled via the optional SpacesARPlaneManagerConfig component.

Available detection modes:

  • PlaneDetectionMode.Horizontal — detects horizontal surfaces only.
  • PlaneDetectionMode.Vertical — detects vertical surfaces only.
  • PlaneDetectionMode.Horizontal | PlaneDetectionMode.Vertical — detects both.

PlaneManager Configuration:

arPlaneManager.requestedDetectionMode = PlaneDetectionMode.Horizontal | PlaneDetectionMode.Vertical;

Known Issue: Plane Detection enters an infinite mesh triangulation loop in AR Foundation 6.0.
Known Issue (Unity 6 + OpenXR 1.15.1): Plane Detection does not work in Dual Render Fusion apps.


Camera Frame Access

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Camera Frame Access.

Use AR Foundation’s AR Camera Manager (XRCameraSubsystem). Key features include:

  • Access to raw camera frames in YUV (Y'UV420sp) and YUYV / YUY2 formats.
  • XRCpuImage.GetPlane(int) for CPU-side image access.
  • XRCpuImage.ConvertAsync for asynchronous conversion.
  • ARCameraManager.currentConfiguration / GetConfigurations for resolution queries.
  • ARCameraFrameEventArgs.displayMatrix for display transformation.
  • GPU-accelerated RGB frame access for All-in-One devices (via OpenGL).
  • Retrieval of sensor extrinsics / pose via InputBindings.

Important: Enable Allow ‘unsafe’ Code in Player Settings > Android > Other Settings > Script Compilation when using the Camera Frame Access sample. Disable AR Camera Background to avoid rendering issues.

YUV Frame Access Example:

void OnCameraFrameReceived(ARCameraFrameEventArgs args)
{
    if (cameraManager.TryAcquireLatestCpuImage(out XRCpuImage image))
    {
        using (image)
        {
            // Access the Y plane (luminance)
            XRCpuImage.Plane yPlane = image.GetPlane(0);
            // yPlane.data contains the raw data
        }
    }
}

Spatial Meshing

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Spatial Meshing.

Use AR Foundation’s AR Mesh Manager (XRMeshSubsystem). The optional SpacesARMeshManagerConfig component controls mesh characteristics and manages camera height offsets for TrackingOriginMode.Floor.

Configurable parameters via SpacesARMeshManagerConfig:

  • Mesh density and granularity.
  • Management of the camera’s vertical offset in Floor mode.

Note: Some properties of AR Mesh Manager are not supported and generate runtime warnings.


QR Code Tracking

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > QR Code Tracking.

Use the custom SpacesQrCodeManager component. It supports multiple tracking modes to control the algorithm’s computation frequency.

Note: There is no editor simulation subsystem for QR Code Tracking. Bypass subsystem checks in editor builds:

bool CheckSubsystem()
{
#if UNITY_EDITOR
    return arQrCodeManager.subsystem?.running ?? false;
#else
    return true;
#endif
}

Hand Tracking

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Hand Tracking.

Hand Tracking is provided by the QCHT (Qualcomm Hand Tracking) plugin packages. For LeonardoXR, the XR Hands package (v1.7.2) from Unity is used as the joint data access layer, integrated with QCHT extensions.

The Auto Start toggle in the OpenXR feature settings controls whether Hand Tracking automatically restarts when the headset reconnects after a disconnection.

Warning: To ensure Hand Tracking works correctly on LeonardoXR, the Hand Tracking Subsystem option must be enabled in All Features within OpenXR.

For complete Hand Tracking integration with the XR Interaction Toolkit, see the Interaction Package Guides.


Foveated Rendering

Enable via Project Settings > XR Plug-in Management > OpenXR (Android tab) > Snapdragon Spaces > Foveated Rendering.

Foveated rendering reduces GPU load by rendering the peripheral field of view at a lower resolution, concentrating resolution at the center of gaze. Foveation settings persist after pausing and resuming the application.

Available foveation levels:

  • None — no reduction.
  • Low — light reduction, imperceptible to most users.
  • Medium — good balance between quality and performance.
  • High — maximum reduction, recommended only for scenes with heavy 3D content.

LeonardoXR Features

The following features are specific to Leonardo XR and are not part of the base Snapdragon Spaces platform.

Enable LeonardoXR features via Project Settings > XR Plug-in Management > OpenXR (Android tab) > LeonardoXR feature group.


Dual Camera Access

⚠️ Documentation in preparation.

This feature enables synchronized access to the frames from the Leonardo XR device’s two cameras. Detailed documentation on the API, configuration, and sample code will be available in a future version of the guide.


QNN Inference Plugin

⚠️ Documentation in preparation.

This feature exposes the hardware neural inference capabilities of the Leonardo XR via the Qualcomm Neural Network (QNN) runtime. It enables running AI/ML models directly on the device’s NPU. Detailed documentation on the API, model conversion workflow, and sample code will be available in a future version of the guide.


Intercept OpenXR Function

⚠️ Documentation in preparation.

This advanced feature provides a mechanism to intercept and override low-level OpenXR functions. It is intended for specialized use cases requiring direct control over the OpenXR layer. Detailed documentation on usage will be available in a future version of the guide.