Table of Contents

Using EasyAR samples on XR headsets or glasses

EasyAR provides unified samples for all headsets. The samples contain no code and are entirely implemented through scene configurations. For usage of the features themselves, refer to the sample implementations on Android/iOS mobile phones.

The headset sample names are Combination_BasedOn_*, for example, the Pico sample is Combination_BasedOn_Pico. This sample demonstrates most EasyAR features in a single scene. They can be dynamically enabled/disabled, used individually, or opened simultaneously.

Preparations

  • Confirm your headset or glasses are currently on the EasyAR support list
  • Download and import the EasyAR Unity plugin package
  • Download and import the EasyAR Unity XR device extension package
  • Obtain an EasyAR license suitable for XR headsets or glasses. Available license types include:
    • EasyAR Sense 4.x XR License Trial Edition (trial, self-activated on EasyAR website)
    • EasyAR Sense 4.x XR License Official Edition (paid, contact sales to purchase)
    • EasyAR Sense 4.x XR License Enterprise Edition (for Enterprise SDK use)
Caution

Only XR Licenses are allowed on headsets and glasses. Ordinary licenses cannot enable EasyAR features.

Import official samples

  1. Samples for built-in supported devices are located within the EasyAR Unity plugin package. Import the required sample based on the device. xr-samples-location

  2. Samples for devices supported via extensions are distributed with the corresponding headset extension. Import them into your project using Unity. Taking Pico as an example: xr-pico-extension

Build and run the sample

Complete headset project configuration and sample usage instructions separately.

Usage instructions

The sample includes multiple buttons with the following functions. xr-sample-usage-7

  • Button 1 HUD: Toggles the UI display mode. Initially, the UI is fixed in the real world. Enabling HUD makes the UI always appear in front of the eyes.
  • Button 2 Record: Toggles EIF recording. Recording must be stopped to generate a usable EIF file; otherwise, the file will be invalid.
  • Button 3 Image: Toggles image tracking.
  • Button 4 Image Fusion: Toggles image tracking + motion fusion mode.
  • Button 5 Dense: Toggles dense spatial mapping.
  • Button 6 Sparse: Toggles sparse spatial mapping.
  • Button 7 Mega: Toggles Mega.

Feature details

  • Default feature states All features are disabled by default at startup. This is achieved by deactivating the corresponding scripts in the editor. Button operations enable/disable these scripts. You can set the default enabled features based on the sample you intend to run. hmd-default-disable

  • Coordinate system origin reference A stationary panda model is placed at the origin of the motion tracking coordinate system to verify motion tracking status. This model is helpful for troubleshooting. For example, if Mega exhibits rapid drift caused by device motion tracking (device defect), this model will drift accordingly. You can adjust or remove the panda model as needed.

  • Using embedded image tracking targets

    • The sample predefines the size of the image used for planar image tracking. You need to print namecard.jpg on A4 paper, ensuring the image is not stretched, cropped, and fills the paper as much as possible (image below). namecard
    • Measure the actual physical length of the printed namecard pattern. Based on this measurement, set the Scale of the Image Target in the Unity scene to match the true physical size (in meters). set-the-actual-size
    • When EasyAR Motion Fusion is enabled, only fixed-position (non-movable) images can be tracked. If motion fusion is disabled, the image cannot be tracked when it leaves the field of view.
    • Sometimes the glasses' view may not accurately reflect the camera image size. If tracking fails, try moving the glasses camera closer to the image. For practical use, tracking larger images (e.g., 5m x 5m) is recommended.
Note

On headsets, whether EasyAR Motion Fusion is enabled or disabled, the Scale parameter of the Image Target must be set to the true physical size; otherwise, the display position will be incorrect.