XREAL Markers

Introduction

Introducing XREAL Markers, a novel set of 'interactive' image tracking cards designed to facilitate virtual and real-world interaction. By manipulating the magnetic sliders on the cards, users can engage in dynamic gameplay experiences. The cards are available in three distinct colors: green for bidirectional functionality, blue for tridirectional, and orange for six-directional capabilities. Developers are encouraged to leverage the cards' interactive features to innovate and enhance both new and existing applications. Additionally, we invite you to explore the sample application 'Spatial Life,' thoughtfully crafted by the XREAL design team.

Requirement

To ensure optimal performance and compatibility when using the Spatial Life application, the following hardware and software specifications must be met:

For developers interested in creating applications akin to Spatial Life, with feature coaster image tracking, additional resource is required:

NRSDKForUnity Experimental

2024.04.18

Fixed: The problem of not being recognized after switching back from the background.

2024.03.29

Developer Guide

Learn how to use the Coasters Image Tracking feature in your own apps.

  • Create a new project in Unity.

Need help setting up? Try Getting Started with NRSDK first

  • Click NRSDK -> CoastersTrackingModule -> Install

Note that the coasters image tracking is not compatible with the original image tracking. If you want to use the old version SDK, click uninstall.

  • Open scene CoastersimageTracking

  • Modify your application logic as needed. The editor includes a simulator for image tracking, demonstrated in the screenshot below. This simulator provides 11 buttons, each corresponding to one of the 11 images. By clicking these buttons, you can simulate the tracking effect for the respective image.

  • The Marker feature uses a trained data sample. The sample resource address is shown in the figure below. It needs to be specified in the SessionConfig resource.

  • Before building an APK, please add the following lines inside the <application> element of your AndroidManifest.xml

<uses-library android:name="libOpenCL.so" android:required="false"/>
<uses-library android:name="libcdsprpc.so" android:required="false"/>

Usage

Get the current tracked Image list.

NRFrame.GetTrackables<NRTrackableImage>(m_TempTrackingImages, NRTrackableQueryFilter.All);

Get the tracking status of Image

In Marker, the GetTrackingState method will only return two states: Tracking and Paused.

NRTrackableImage.GetTrackingState() 

    /// <summary> Device Tracking State. </summary>
    public enum TrackingState
    {
        /// <summary>
        /// TRACKING means the object is being tracked and its state is valid.
        /// </summary>
        Tracking = 0,

        /// <summary>
        /// PAUSED indicates that NRSDK has paused tracking, 
        /// and the related data is not accurate.  
        /// </summary>
        Paused = 1,

        /// <summary>
        /// STOPPED means that NRSDK has stopped tracking, and will never resume tracking. 
        /// </summary>
        Stopped = 2
    }

Get the ID of the Image

In Marker, the value range of ID is [0,10], corresponding to different states of Marker cards.

NRTrackableImage.GetCoastersDataBaseIndex()

Get image pose and size information

// The length in the X direction of the image
NRTrackableImage.ExtentX
// The length in the Z direction of the image
NRTrackableImage.ExtentZ
// Get the pose of the center of the image
NRTrackableImage.GetCenterPose

Enable and disable ImageTracking functionality

/// <summary> Enables the image tracking. </summary>
public void EnableImageTracking()
{
    var config = NRSessionManager.Instance.NRSessionBehaviour.SessionConfig;
    config.ImageTrackingMode = TrackableImageFindingMode.ENABLE;
    NRSessionManager.Instance.SetConfiguration(config);
}

/// <summary> Disables the image tracking. </summary>
public void DisableImageTracking()
{
    var config = NRSessionManager.Instance.NRSessionBehaviour.SessionConfig;
    config.ImageTrackingMode = TrackableImageFindingMode.DISABLE;
    NRSessionManager.Instance.SetConfiguration(config);
}

Last updated