Using the Device Tracker in Unity

Vuforia Engine supports the development of space-aware AR experiences with the Positional Device Tracker.  The Device Tracker provides information about where the device is relative to the world.  It works well for AR applications that need to place content in the environment or want to provide additional robustness to target tracking with six degrees-of-freedom.

This article describes the use of the Device Tracker in Unity. If you are developing an application for native Android or iOS, refer to the Using the Device Tracker in Native article.

The Positional Tracker is Enabled by Default

When creating a new Unity project and importing the Vuforia Engine, the Track Device Pose is enabled by default in any of your scenes. The Positional Device Tracker is required for the Ground Plane and the Area Target feature and recommended for Model Targets. In addition, the Positional Device Tracker enables Extended Tracking for all target types and it is also used to recover from application interrupts using Vuforia Continued AR Experiences behavior.

To disable the Device Tracker

  1. In the Windows menu, select Vuforia Configuration.
    The VuforiaConfiguration Inspector window opens.
  2. Expand the Device Tracker section and disable the Track Device Pose.
    If you are using a device tracking dependent Vuforia feature, disabling the Device Tracker will cause errors.

Using the Tracking Mode

Configure the Trackable in the Unity Editor via the DefaultTrackableEventHandler. Choose if the target should render content when it is "Tracked", "Extended Tracked" or also when only a "Limited" pose is available. This allows for per-trackable configuration of extended tracked poses.

If a trackable is reported with status "Limited", only an inaccurate pose is available. It should only be taken into consideration if close alignment of virtual content and real-world object is not required.

Please refer to Interpreting Tracking State API Results for more information on handling the STATUS and STATUS_INFORMATION.

Android specific Device Tracker settings

When developing a Unity application for Android, enable ARCore on supported devices that have it installed. The following explains the options available in the Android Settings section:

By default, the ARCore Requirement dropdown is set to OPTIONAL. In this mode, Vuforia Engine uses VISLAM or SLAM on devices that do not support ARCore. Set the dropdown to REQUIRED to indicate that the app can only be installed on devices that support ARCore. Set the dropdown to DON’T USE to indicate that the app will not use ARCore.

If OPTIONAL or REQUIRED are selected, then ARCore is enabled and Vuforia Engine requires that the ARCore client library is packaged with the application so that ARCore functionality can be accessed at runtime. Select Include ARCore library to automatically include the latest supported library version. This is only supported when using Gradle to build the application.

If Include ARCore library is disabled, then the developer needs to package the ARCore client library with the app by including it in the Plugins/Android folder of the Unity project.

For more information, refer to the Enable ARCore article.