Table of Contents

Use the session validation tool

This article explains how to use the session validation tool to quickly validate session workflows in the editor and simulate runs using EIF files.

Before you begin

Simulation runs use EIF files as input, so before starting, you need to record an EIF file:

You also need to understand:

Session validation tool

The session validation tool is used to help developers quickly validate the session workflow and simulate operations using EIF files in the Unity editor.

By default, the session validation tool can be seen in the Inspector window of the AR Session (EasyAR) object, as part of the DiagnosticsController editor:

alt text

Click the button in the upper-right corner of the tool to pop it out as an independent window for easier viewing and operation. When the window is closed or the button is pressed, the tool will reappear in the Inspector window.

alt text

The effect of the tool during runtime is shown in the following video:

This video demonstrates the usage effect of the session validation tool, recorded in Unity's play mode. The upper part of the video shows the Hierarchy view on the left, the Scene view in the middle, and the Game view on the right. The lower part of the video shows the session validation tool. The content of the Game view is the same as what users see in the real world on their mobile phones.

The upper-left part of the tool displays the EIF playback progress bar, which changes as the playback progresses. The lower-left part of the tool shows the current session status. The right side of the tool displays the session components and available center modes.

In the scene, you can see three AR features working simultaneously:

  • Motion tracking: provided by the frame player, the blue sphere is the XR Origin, and the blue cone represents the user's position.
  • Dense spatial mapping: as the viewpoint moves, semi-transparent mesh models are continuously generated.
  • Sparse spatial tracking: in the video, a Christmas tree is being tracked, and the overlaid virtual object is a light blue point cloud.

Start the tool

Click the button at the top of the tool to start it. Pressing this button has the same effect as directly pressing the button on the Unity toolbar.

alt text

If the tool is already started, the button will change to , and clicking it will stop the tool.

When the tool is displayed in an independent window, the dropdown box to the right of the button allows you to select the session object used by the tool. If the window is reset and the session is lost, you can reselect it from here.

Control EIF playback

To use the EIF playback feature of the tool, you need to check the Frame Player option of the tool before running. At this time, the tool will take over the selection of the frame source during the session assembly process. Regardless of the value set for AssembleOptions.FrameSource, the frame player component will be enabled.

alt text

Therefore, a pop-up prompt will appear during runtime, indicating that the frame source used by the current session has been taken over by the tool:

alt text

Note

The tool will only take over the selection of the frame source during the assembly process on the Unity editor. This option has no effect when the application is packaged and run.

During normal operation, the EIF playback control function will be displayed in the part outlined in the upper part of the tool:

alt text

You can use these buttons to control the playback of the EIF file:

  • : Play, resume playback from a paused or stopped state
  • ▮▮: Pause
  • : Stop
  • ▮◀: Jump to 5 seconds earlier (when the file supports it)
  • ◀◀: Decrease playback speed (when the file supports it)
  • ▶▶: Increase playback speed (when the file supports it)
  • ▶▮: Jump to 5 seconds later (when the file supports it)
  • : Open file
  • Progress bar: Click to jump to a playback position (when the file supports it)

You can adjust the content and interaction logic in the optimization scene while playing, so that most of the development work can be done on the computer, and the effect can be seen intuitively.

Note

When playing new data or jumping to a playback position, the original data in the scene will not be cleared. The state of the AR components will also not be reset. They will behave as if the camera data suddenly jumps from the previous frame to the new data.

Although this does not have much impact on some functions, for functions that rely on motion tracking (such as dense spatial mapping, Mega, etc.), it may cause abnormal function states, thereby affecting the running effect.

Control session workflow

To use the session workflow control feature of the tool, you need to check the Session Workflow option of the tool before running. This option is checked by default.

alt text

During normal operation, the session workflow control feature will be displayed in the area outlined below the tool's playback control:

alt text

At the top of the entire area, the status information of EasyARController.IsReady and ARSession.State is displayed.

At the bottom of the entire area, these buttons are provided to control the session workflow:

  • Initialize: Initialize the session, with the option to use the license key configured in Project Settings or manually enter a license key
  • Assemble: Assemble but do not start the session
  • StartSession (Assembled): Start the assembled session
  • StartSession: Assemble and start the session
  • StopSession: Stop the session
  • StopSession (keep image): Stop the session but keep the image background
  • Deinitialize: Deinitialize the session
Note

Since these control features directly call the relevant methods of ARSession and EasyARController, you can use these buttons to verify the impact of session state changes on the content. However, it is important to note that if similar methods are also called in the application script, the application's running process may deviate from its intended flow.

Control session assembly

To use the session assembly control feature of the tool, you need to check the Session Workflow option of the tool before running, which is checked by default.

alt text

During normal operation, the session assembly control will be displayed in the lower or right part of the tool, as outlined in the figure below. The specific position depends on the window width:

alt text

The content displayed in this area is related to the specific session. For example, the session used in the above image includes three functional components: image tracking, dense spatial mapping, and sparse spatial tracking. Therefore, the tool displays control checkboxes for these three functions.

Generally, this area will display all available AR functional components in the session and provide enable/disable (enabled) controls for these components, including:

  • AR Session: Controls the enable/disable of the session itself
  • Image Renderer: Controls the enable/disable of physical camera image rendering
  • Camera: Controls the enable/disable of the virtual camera
  • Frame Source: Controls the enable/disable of the frame source. It can only be controlled when the frame player is not enabled. When the frame player is enabled, the function control is replaced by the EIF playback control part
  • Frame Filter: Controls the enable/disable of specific AR functions
  • Frame Recorder: Controls the enable/disable of the EIF recording component. It is only visible when the frame player is not enabled. When the frame player is enabled, this component will not be assembled into the session

At the same time, the available center modes and session report of the session will also be displayed in this area.

Note

The available center modes and session report displayed in the tool are the results of running in the editor and may differ when running on an actual device.