Samples Guide — LeonardoXR SDK

Samples Guide — LeonardoXR SDK

Samples Guide — LeonardoXR SDK

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

The samples are organized into two sections:

  • LeonardoXR Samples — samples specific to Leonardo XR’s proprietary features.
  • Snapdragon Spaces Core Samples — samples provided by Qualcomm for base AR/XR features.

Importing the Samples

Snapdragon Spaces Core Samples

The Core Samples package can be imported via Window > Package Manager > Snapdragon Spaces > Core Samples. After importing, add all scenes to the build through Window > XR > Snapdragon Spaces > Add Scenes to Build Settings.

LeonardoXR Core Samples

The LeonardoXR Core Samples package can be imported via Window > Package Manager > LeonardoXR > Core Samples. After importing, the scenes are available in the Samples/LeonardoXR/[version]/Core Samples/Scenes/ folder.


LeonardoXR Samples

Dual Camera Access Sample

⚠️ Documentation in preparation.

This sample demonstrates how to access synchronized frames from Leonardo XR’s dual cameras using the Dual Camera Access feature.

Scene: Samples/LeonardoXR/.../Core Samples/Scenes/DualCameraAccess Prerequisites: The Dual Camera Access feature enabled in the LeonardoXR feature group.


QNN Inference Sample

⚠️ Documentation in preparation.

This sample demonstrates how to load and run a neural inference model on Leonardo XR’s NPU using the QNN Inference Plugin.

Scene: Samples/LeonardoXR/.../Core Samples/Scenes/QnnInference Prerequisites: The QNN Inference Plugin feature enabled in the LeonardoXR feature group.


Intercept OpenXR Function Sample

⚠️ Documentation in preparation.

This sample demonstrates how to intercept low-level OpenXR functions using the InterceptOpenXRFunction feature.

Scene: Samples/LeonardoXR/.../Core Samples/Scenes/InterceptOpenXRFunction Prerequisites: The Intercept OpenXR Function feature enabled in the LeonardoXR feature group.



Snapdragon Spaces Core Samples

Local Anchors Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/Anchor

This sample demonstrates how to create and destroy local anchors to precisely track a point in the real world. It requires the Spatial Anchors feature enabled in OpenXR.

How It Works

A transparent positioning gizmo floats 1 meter in front of the camera. When Place anchor on surfaces is enabled, a ray is cast forward every frame. When a surface is hit, the gizmo turns yellow. Tapping the touchpad or using the gaze interactor creates an ARAnchor with a tracking gizmo.

private void OnAnchorsChanged(ARAnchorsChangedEventArgs args)
{
    foreach (var anchor in args.updated)
    {
        Destroy(anchor.transform.GetChild(0).gameObject);
        var newGizmo = Instantiate(
            anchor.trackingState == TrackingState.None
                ? GizmoUntrackedAnchor
                : GizmoTrackedAnchor);
        newGizmo.transform.SetParent(anchor.transform, false);
    }
}
Saving, Deleting, and Loading Anchors
  • Enable Save new anchors to local store to persist each new anchor.
  • A white cube on the gizmo = saved and tracked anchor; red cube = not tracked.
  • Load All Saved Anchors — loads and attempts to locate all stored anchors.
  • Clear Store — deletes all stored anchors (does not destroy anchors already loaded).
  • Destroy All Anchors — destroys all active anchor GameObjects (with a short delay).

Hand Tracking Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/HandTracking

Demonstrates hand joint visualization and gesture recognition using the QCHT interaction package. Requires the Hand Tracking feature and the QCHT / XR Hands packages.


Hit Testing Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/HitTesting

Demonstrates continuous hit testing via raycasting against real-world planes and meshes using ARRaycastManager. The sample shows how to place virtual objects on detected surfaces.


Image Tracking Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/ImageTracking

Demonstrates tracking of printed reference images and overlaying virtual content. Supports static and mutable image libraries.


Plane Detection Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/PlaneDetection

Demonstrates the detection and visualization of horizontal and vertical planes using ARPlaneManager. Supports optional detection modes and convex hull planes.


Camera Frame Access Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/CameraFrameAccess

Demonstrates the retrieval of raw camera frames (YUV / YUYV) from the device using ARCameraManager. Includes sensor extrinsics, camera count queries, and GPU-accelerated frame access.

Important: Requires Allow ‘unsafe’ Code enabled in Player Settings.


Spatial Meshing Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/SpatialMeshing

Demonstrates real-time environmental meshing using ARMeshManager. Includes an opacity slider and the optional SpacesARMeshManagerConfig component.


QR Code Tracking Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/QRCodeTracking

Demonstrates QR code scanning and tracking via SpacesQrCodeManager. Multiple tracking modes are available.


XR Interaction Toolkit Sample

Scene: Samples/Snapdragon Spaces/.../Core Samples/Scenes/XRInteractionToolkit

Demonstrates standard XR Interaction Toolkit interactions (ray interactors, direct interactors, teleportation) in a Snapdragon Spaces project. Compatible with LeonardoXR configuration.


Interaction Components

Composition Layer Components

The Spaces Composition Layer renders textures directly to the HMD, bypassing post-processing steps. Supported geometry types are Quad, Cylinder, Sphere, and Cube. Useful for high-resolution UI or elements that must maintain quality regardless of scene effects.


Additional Samples

Sample Description
Display Refresh Rate Runtime querying and setting of the display refresh rate via the XR_EXT_display_refresh_rate extension.
Performance Settings Setting CPU/GPU performance levels via the XR_EXT_performance_settings extension.