# Spatial Localization SDK

The Spatial Localization SDK provides robust geospatial capabilities with support for Unity, WebXR, and Meta Quest 3 devices.

## 🔍 Introduction

This SDK uses spatial localization services for immersive experiences. It is compatible with Unity-based applications.

## 📦 Usage Guide

### 🔧 General Instructions

Before using the SDK:

1. Configure the SDK at:
   - `Assets/CBLP_VPSService/Setting/CLAPSetting.asset`
2. Contact technical support to obtain:
   - Model scale
   - Inference server access

---

### 🧩 1. Unity

Used for building Android and iOS applications.

**Requirements**
- `com.unity.xr.arfoundation` version **6.0.5** or higher

**Sample Scene**
- `Assets/CBLP_VPSService/Scenes/ARFoundationTracking.unity`

---

### 🥽 2. Meta Quest 3

Build immersive applications for Meta Quest 3 and Quest 3S headsets.

**Requirements**

**Software**
- Unity (Tested with version `6000.0.44f1`)
- Meta XR Core SDK (`com.meta.xr.sdk.core` version **74.0.2** or higher)

**Hardware**
- Meta Quest Devices:
  - Quest 3
  - Quest 3S
- Horizon OS version **v74** or higher

**Permissions**
- Android:
  - `android.permission.CAMERA` — Required for `WebCamTexture`
  - `horizonos.permission.HEADSET_CAMERA` — Custom Meta permission for passthrough camera access

**Features**
- Android:
  - `com.oculus.feature.CONTEXTUAL_BOUNDARYLESS_APP` - Enables the app to operate with Oculus’s boundaryless context system, allowing immersive experiences without traditional Guardian boundary constraints.

**Notes**

- If the user moves too far away, a "move too far" warning will appear. This can be resolved by disabling the **physical space feature.**
- How to turn off the Physical Space feature on Meta Quest devices:
1. Put on your Meta Quest headset and press the **Oculus button** on your right controller to open the Universal Menu.
2. Select **Settings** (gear icon) from the menu.
3. Scroll down and select **Advanced**.
4. Find the option labeled **Physical Space Features**.
5. Toggle **Physical Space Features** off to disable the feature that tracks and limits your physical movement.
6. Confirm any prompts that appear to save your settings.

**Usage**
- Open: `Assets/CBLP_VPSService/Scenes/MetaQuestTracking.unity`
- Use: `Meta > Tools > Project Setup Tool` to fix project configuration issues.

**Known Issues**
- VPS might not work on first launch post-build. Restarting the app usually resolves this.

---

### 🌐 3. WebXR

**Platform Support**
- Android: Chrome
- iOS: WebView (with SDK)

**Setup Steps**
1. Open the **XR Plug-in Management** tab in Project Settings.
2. Select the **WebXR Export** plug-in provider.
3. In `Project Settings > Player > Resolution and Presentation`, set the WebGL Template to `WebXRTracking`.
4. Build WebGL.

**Integration Guide**
- Follow the documentation: [XenseAR WebGL SDK Overview](https://xensear.vn/docs/SDK/geospatial/XenseARWebGLSDK/overView)

---

### 🌐 4. XREAL One Pro

## Build for XREAL
- Unity Pro (Tested with version `6000.0.60f1`)
- com.xreal.xr 3.1.0 sdk download from
**Hardware**
- XREAL One series + eye + Beam (Tested on one pro)

**Permissions**
- CAMERA

**HowToBuild**
- Install package following "https://docs.xreal.com/Getting%20Started%20with%20XREAL%20SDK"
- Check: `Project Settings - XR Plug-in Management - android section - Initialize XR on Startup` and  `Plug-in Providers - Apple XREAL` 
- Open Scene "XrealTracking"
- add define "UNITY_XREAL" in player settting
- Build apk then deploy to beam
**Important note**
- Fix all error in project validation after install package
- Wireless ADB strongly recommended for easy debug
- Known issue: RGB camera may fail on second app launch; unplug and re-plug the XREAL glasses to reset.Intrinsics are estimated, not retrieved

---

## 📬 Support

Please reach out to the technical support team for model scaling and inference server setup.
