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
- Navigate to Edit > Project Settings > XR Plug-in Management, then open the Android tab.
- Enable the OpenXR plug-in and the Snapdragon Spaces feature group.
- Click the red exclamation mark next to OpenXR to open the OpenXR Project Validation window.
- Select Fix for each listed issue.
- 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:
| Feature | AR Foundation Manager | XR Subsystem |
|---|---|---|
| Base Runtime | AR Session | XRSessionSubsystem |
| Camera Frame Access | AR Camera Manager | XRCameraSubsystem |
| Hit Testing | AR Raycast Manager | XRRaycastSubsystem |
| Image Tracking | AR Tracked Image Manager | XRImageTrackingSubsystem |
| Plane Detection | AR Plane Manager | XRPlaneSubsystem |
| Spatial Anchors | AR Anchor Manager | XRAnchorSubsystem |
| Spatial Meshing | AR Mesh Manager | XRMeshSubsystem |
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 Tracking, Eye Tracking, Passthrough, Controllers 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
- Open Window > Package Manager, select the Snapdragon Spaces package.
- Click Import on Core Samples.
- 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()inMainMenuSampleController, which setsPassthroughToggleonBaseRuntimeFeature.
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
minAPIfor all the features is0.22.0.
Compatibility Results
| Risultato | Descrizione |
|---|---|
| Success | Nessuna incompatibilità rilevata. |
| Error Runtime Failure | Errore del runtime OpenXR. |
| Error Validation Failure | Errore nella validazione Older Runtime Compatibility. |
| Error Uninitialized System | Errore per mancanza di inizializzazione. |
| Error Runtime Too Old For Application | Il runtime installato è troppo vecchio per l’SDK. |
| Error Application Too Old For Runtime | L’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.trackableIdalways gives back0-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 Managerwhen there is aXR Raycast Interactor, enabling Spatial Meshing regardless of the flagEnableARRaycasting. 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 Managerabilitato può causare freeze. DisabilitaAR Camera Backgroundper 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+.