VR/MR - LeonardoXR SDK

VR/MR — LeonardoXR SDK

VR/MR — LeonardoXR SDK

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


Manual Configuration

It’s recommended to use the Configuration Tool for initial project setup (see Getting Started). This guide describes the equivalent manual steps for those who prefer direct control over the settings.

Configuration of Project Settings

  1. Navigate to Edit > Project Settings > XR Plug-in Management, then open the Android tab.
  2. Enable the OpenXR plug-in and the Snapdragon Spaces feature group.
  3. Click the red exclamation mark next to OpenXR to open the OpenXR Project Validation window.
  4. Select Fix for each listed issue.
  5. Apply the Enable Both Input Systems setting last, as it requires restarting the Editor.

Play In Editor: For additional settings related to the workflow in the editor see the dedicated section in Getting Started.

Enable Space Features

Enable features that should be active at runtime in OpenXR Settings. Each feature corresponds to an AR Foundation Manager and an XR Subsystem:

FeatureAR Foundation ManagerXR Subsystem
Base RuntimeAR SessionXRSessionSubsystem
Camera Frame AccessAR Camera ManagerXRCameraSubsystem
Hit TestingAR Raycast ManagerXRRaycastSubsystem
Image TrackingAR Tracked Image ManagerXRImageTrackingSubsystem
Plane DetectionAR Plane ManagerXRPlaneSubsystem
Spatial AnchorsAR Anchor ManagerXRAnchorSubsystem
Spatial MeshingAR Mesh ManagerXRMeshSubsystem

Add Feature Usage Data to the Android Manifest

Navigate to Edit > Project Settings > Snapdragon Spaces Launcher Settings to declare the features required or supported by the application for: Hand TrackingEye TrackingPassthroughControllers e Room Scale.

Attention: By default, all uses-feature values are set to true. Set features not used by your application to false to avoid false requirements in the manifest.

Import the Samples

  1. Open Window > Package Manager, select the Snapdragon Spaces package.
  2. Click Import on Core Samples.
  3. Add all scenes to the build via Window > XR > Snapdragon Spaces > Add Scenes to Build Settings.

Important:  The Camera Frame Access sample requires unsafe mode enabled in Player Settings > Android > Other Settings > Script Compilation > Allow ‘unsafe’ Code.


Passthrough Setup

Passthrough allows you to view your physical environment as an image overlay on VR devices. It’s available on compatible devices on LeonardoXR.

  • It is activated via the Extend Content panel in the in-app UI (visible only on Passthrough-compatible devices).
  • It can also be activated with the X and A buttons on the controller.
  • The enable fuction is OnPassthroughToggle() in MainMenuSampleController, which sets PassthroughToggle on BaseRuntimeFeature.

ATTENTIO: LThe session camera must have the Background Alpha channel set to 0 to use Passthrough correctly. An automatic warning is logged if the settings are incorrect.

The delegate OnSpacesAppSpaceChange in BaseRuntimeFeaturenotifies when the device performs a recenter (activated by holding down the menu button for 2 seconds on the VRX).


Scene Setup

Note: This guide assumes prior knowledge of AR Foundation and OpenXR. Consult the official AR Foundation and OpenXR documentation for basic concepts.

Minimum Scene Hierarchy

To enable positional head tracking on LeonardoXR you need the following items:

AR Session
XR Origin
  └── Camera Offset
        └── Main Camera (tagged as "MainCamera")

Create them by right-clicking in the Hierarchy and selecting XR > AR Session or XR > XR Origin.

Attention:

Disable the AR Camera Manager component if you are not fetching RGB frames from the camera, to avoid lifecycle issues.

Important: Disable the AR Camera Background component – it is not supported and will be automatically disabled at runtime.

Application Lifecycle — Compatibility with Previous Runtimes

The library Older Runtime Compatibility

Prevents the application from launching when the SDK is not compatible with the OpenXR runtime installed on the device.

Two entries are added to the Android manifest at startup:

  • targetAPI — corresponds to the version of the OpenXR runtime included in the SDK.
  • minAPI — the minimum runtime version that each feature supports.

Versione: Starting with Snapdragon Spaces 1.0.4, the minAPI for all the features is 0.22.0.

Compatibility Results

RisultatoDescrizione
SuccessNessuna incompatibilità rilevata.
Error Runtime FailureErrore del runtime OpenXR.
Error Validation FailureErrore nella validazione Older Runtime Compatibility.
Error Uninitialized SystemErrore per mancanza di inizializzazione.
Error Runtime Too Old For ApplicationIl runtime installato è troppo vecchio per l’SDK.
Error Application Too Old For RuntimeL’SDK è troppo vecchio per il runtime installato.

When an incompatibility is detected, a pop-up appears with an error message and a Quit button. For apps with Dual Render Fusion, the user is notified, but the application can still launch.


Common Issues — VR/MR on LeonardoXR

For issues not listed here, see the general Snapdragon Spaces platform known issues.

Gradle Build Issue

Adding a custom controller repository can cause Gradle caching errors. Delete the folder. Temp > gradleOut usually solves the problem.

AR Foundation Issues

  • AR Raycast Hit restituisce Trackable ID errato — ARRaycastHit.trackableId always gives back 0-0.
  • Plane Detection blocked — Mesh triangulation enters an infinite loop in AR Foundation 6.2.1.

XRIT Issues

  • AR Raycast Manager added automatically — XRIT 3.x adds an
    AR Raycast Manager when there is a XR Raycast Interactor, enabling Spatial Meshing regardless of the flag EnableARRaycasting. This may reduce performance.
  • Proprietà AR Mesh Manager not supported — Using unsupported properties generates runtime warnings.
  • AR Camera Manager / AR Camera Background Issues — Spostarsi tra scene con AR Camera Manager abilitato può causare freeze. Disabilita AR Camera Background per evitare problemi di rendering.

Play In Editor Known Issues

  • Memory Leak in Camera Access Simulation — Risolved in AR Foundation 6.0+.
  • AR Mesh Manager crash senza Normals —Update AR Foundation or enable normals.
  • QR Code Tracking non caricato in Simulation — There is no simulation subsystem; it bypasses the checks in the build editors.
  • ScriptableSingleton Warning — Resolved in AR Foundation 5.1.2+.