Skip to content

Repository files navigation

Research XR Toolkit (RXT)

RXT_Logo

A Unity toolkit for building VR research experiments with high-quality data collection, experiment management, and HTC eye-tracking support.


Why RXT?

Research XR Toolkit (RXT) was created to eliminate the repetitive work involved in building VR research experiments.

Instead of writing custom scripts every time you need to:

  • Record participant data
  • Save eye tracking
  • Capture facial expressions
  • Generate CSV files
  • Randomize trials
  • Manage participant IDs
  • Play audio
  • Trigger haptics

RXT provides a single API that handles these tasks automatically so researchers can focus on designing experiments rather than infrastructure.

RXT builds on top of SXR.


Walkthrough

Check out the walkthrough video to see RXT in action and learn how the toolkit can be used to build and manage VR research experiments.

RXT Walkthrough

Watch the RXT Walkthrough on YouTube


Features

  • ✅ Automatic CSV data collection
  • ✅ HTC Vive Focus Vision Support
  • ✅ HTC Vive Pro Eye Support
  • ✅ Eye Tracking
  • ✅ Facial Tracking
  • ✅ Camera Tracking
  • ✅ Baseline Corrected Pupil Diameter
  • ✅ Trial Summary Generation
  • ✅ Timed Event Summary Generation
  • ✅ Audio Manager
  • ✅ Randomization Utilities
  • ✅ Latin Square Generation
  • ✅ Haptic Feedback
  • ✅ Participant ID Management

Getting Started

Research XR Toolkit is distributed as a complete Unity project rather than a Unity package.

Requirements

  • Unity 6
  • Git
  • HTC OpenXR Plugin (included in this repository)
  • SXR (included in this repository)

Installation

Clone the repository.

git clone https://github.com/JohnBacho/ResearchXRToolkit.git

Open Unity Hub.

Select

Add → Add project from disk

Navigate to the cloned repository and select the project folder.

Unity Hub will recognize the project and open it using Unity 6.

Once the project finishes importing, open the sample scene or begin building your experiment.


Built on SXR

RXT is built on top of the Simple XR (SXR) framework developed by Justin Kasowski.

SXR provides the core experiment framework including:

  • Experiment state management
  • Trial management
  • Phase management
  • Step management
  • Timing utilities

RXT extends SXR by adding:

  • Automatic data collection
  • Eye tracking
  • Facial tracking
  • Trial summaries
  • Event summaries
  • Audio utilities
  • Haptics
  • Randomization utilities
  • Participant management

Rather than replacing SXR, RXT expands it into a complete research toolkit.


Data Collection

The data collection system is the core feature of RXT.

Unlike many research frameworks that require manually constructing CSV files, RXT automatically records data every frame.

Each participant receives their own folder:

001/

    Data_2026-08-04_14-52-33.csv

    TrialSummary.csv

    EventSummary.csv

No additional scripting is required.


Recorded Data

The toolkit can automatically record:

Basic Experiment Information

SubjectID
Date
Time
Phase
Trial
Step
State
Unity Time

Camera Tracking

Position X
Position Y
Position Z

Rotation X
Rotation Y
Rotation Z

Eye Tracking

Combined Gaze Origin

Combined Gaze Direction

Left Pupil

Right Pupil

Combined Pupil

Baseline Corrected Pupil

Hit Object

Hit Position

Eye Expressions

All HTC OpenXR Eye Expression blendshapes including:

Blink
Wide
Squeeze
Up
Down
Left
Right

Facial Expressions

Every HTC Lip Expression value including:

Jaw
Cheeks
Tongue
Lips
Mouth
Puff
Stretch
Smile
Pout

Selecting Recorded Data

Not every experiment needs every variable.

Each category can be enabled or disabled in the Unity Inspector.

Individual variables can also be toggled.

For example:

☑ Camera Position

☐ Camera Rotation

☑ Pupil Diameter

☐ Facial Expressions

Only enabled fields are written to disk.

This reduces file size and improves readability.


Automatic CSV Generation

Recording data is as simple as:

rxt.StartRecording();

Pause recording:

rxt.PauseRecording();

The toolkit automatically:

  • creates headers
  • writes data every frame
  • buffers writes for performance
  • flushes data to disk
  • safely closes files when the application exits

Trial Summary Files

Sometimes researchers don't need every frame of data.

Instead they need a single average value for an entire trial.

Enable:

Generate Trial Summary File

RXT will automatically average every numeric value over the duration of the trial.

Example:

Trial

Average Pupil Diameter

Average Head Height

Average Blink Rate

Average Gaze X

Average Gaze Y

Text fields (such as object names or states) are preserved while numeric values are averaged.

No additional scripting is required.


Event Summary Files

Researchers often need to summarize a short event such as:

  • watching a stimulus
  • solving a puzzle
  • pressing a button
  • viewing an image

Instead of averaging an entire trial, RXT can average only a timed section.

Start collecting:

rxt.StartEventSummaryTimer(5f);

This records data for five seconds.

When the timer ends, RXT automatically writes one summarized row into:

EventSummary.csv

You can also stop collection manually.

rxt.StopEventSummaryTimer();

Baseline Corrected Pupil Diameter

Many eye-tracking studies require baseline correction.

RXT performs this automatically.

Capture a baseline:

rxt.StartBaseline(2f);

RXT stores pupil values for two seconds.

Afterward every recorded pupil diameter includes:

Current Pupil

Baseline

Baseline Corrected Pupil
Corrected = Current - Baseline

This allows researchers to analyze cognitive load rather than raw pupil size.


Participant IDs

Participant IDs are handled globally. They are set using unique id manager but can be manually set using

rxt.SetUniqueID(42);

Retrieve it later:

int id = rxt.GetUniqueID();

Participant folders are automatically named using this ID.


Randomization

Generate random integers.

int value = rxt.RandomizeInt(1,10);

Generate randomized arrays.

int[] order = rxt.RandomizeIntArray(1,20,10);

Latin Square ordering.

string[] order =
    rxt.LatinSquare(
        conditions,
        participantID);

Generate balanced trial orders.

string[] trials =
    rxt.GenerateTrialOrder(
        conditions,
        repeats:3);

Audio

Play a sound.

rxt.PlayAudio("Bell");

Loop audio.

rxt.PlayAudioLooped("Ambience");

Stop audio.

rxt.StopAudio("Ambience");

Haptics

Default vibration.

rxt.TriggerHaptic();

Custom vibration.

rxt.TriggerHaptic(
    amplitude:0.5f,
    duration:0.25f);

Supported Hardware

Current support includes:

  • HTC Vive Focus Vision
  • HTC Vive Pro Eye

The toolkit automatically switches between supported eye tracking systems depending on the selected headset.


Performance

The data collection system was designed specifically for research.

Rather than writing directly to disk every frame, RXT:

  • Buffers CSV output
  • Batches file writes
  • Periodically flushes to disk
  • Safely closes streams when the application exits

This minimizes disk overhead while maintaining data integrity.


Building RXT

RXT can be built for either PC VR using the HTC Vive Pro Eye or Android using the HTC Vive Focus Vision. The build process differs depending on the target headset.

PC / HTC Vive Pro Eye

The Vive Pro Eye uses a PC-based VR workflow.

  1. Open the RXT project in Unity 6.
  2. Open:
File → Build Profiles
  1. Select Windows as the target platform.
  2. Make sure the required RXT scenes are included in the build.
  3. Select Build.
  4. Choose an output folder for the application.
  5. Run the generated .exe on the research computer.
  6. Connect the HTC Vive Pro Eye to the computer and ensure the required HTC/VIVE software is running.
  7. Launch the RXT application.

The experiment runs directly on the PC while the Vive Pro Eye provides the VR display and eye-tracking data.


Android / HTC Vive Focus Vision

The Vive Focus Vision uses an Android-based build.

Before building, install and configure the required Android development tools and make sure ADB is available.

  1. Open the RXT project in Unity 6.
  2. Open:
File → Build Profiles
  1. Select Android as the target platform.
  2. Connect the HTC Vive Focus Vision to the development computer.
  3. Enable USB debugging on the headset if prompted.
  4. Verify that the headset is detected through ADB.
  5. Make sure the required RXT scenes are included in the build.
  6. Configure the Android build settings for the Focus Vision.
  7. Select Build And Run.
  8. Unity will build the Android application and deploy it to the connected headset.

The resulting application runs on the Focus Vision as an Android application.

Build Targets

Target Unity Platform Headset Build Output
PC VR Windows HTC Vive Pro Eye .exe
Standalone VR Android HTC Vive Focus Vision .apk

Important

The two headsets require different build targets. Do not build the Focus Vision application using the Windows target, or build the Vive Pro Eye application using the Android target.

For the Vive Pro Eye, build for Windows.

For the Vive Focus Vision, build for Android and use ADB to deploy the application to the headset.

Contact

Lead Developer

John Bacho

📧 bachojohn2@gmail.com

Faculty Advisor

Dr. Brian Thomas

Baldwin Wallace University


Citation

If you use RXT in your research, please cite this repository.

About

A Unity Template desgined to accelerate VR development for research

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages