This repository comes with the code for Tobii Eye Tracking integrated in HTC VIVE Eye Pro in Unity, Which is a part of projects from Omni-Reality and Cognition Lab in University of Virginia (https://engineering.virginia.edu/omni-reality-and-cognition-lab).
- HTC VIVE Eye Pro with Tobii Eye Tracking system
- Unity version 2018.4.16
- Python 3.6.3 (Anaconda version recommended)
- SteamVR
- Finish the Set up for the HTC VIVE Eye Pro
- Tobii Pro SDK for your platform
The HTC VIVE Eye Pro hardware (headset, controller) is from HTC VIVE, the integrated eye tracker is from Tobii, they have provided multiple ways to get access to the eye tracking data:
- Tobii Pro SDK: A general SDK for getting eye tracking data. This repository will use Python and Unity only.
- Tobii XR SDK: SDK for Unity, developed by Tobii too, to get started, follow the steps in this link. Tobii XR requires a analytical license to get the raw data, otherwise, eye tracking can only be used for interactive use.
- Vive Eye Tracking SDK : SDK for eye tracking from HTC. The forum for it can be found here.
This repository includes sample code and tutorials for Python and Unity API of Tobii Pro SDK only.
Website of Tobii Pro SDK: http://developer.tobiipro.com/index.html
You can either use Python API or Unity API to get the eye tracking data.
Set up Python API as http://developer.tobiipro.com/python/python-getting-started.html.
Then run the TobiiEyeTracking.py in the repository to collect the data externally (not within Unity).
If an eye tracker is successfully found, the data collecting is on going until the key 'q' is pressed (you can also change it to another key in the code). An output .csv data file (name with the start and end time like sample_output) will be exported into the out_dir defined in the code.
output_dir = 'C:/github/ORCL_VR_EyeTracking/Data/EyeTrakcing/TobiiProPython'
To start with, read the document from Tobii Pro SDK (http://developer.tobiipro.com/unity.html) and download the Tobii Pro SDK for Unity.
- Create a new project, or open an existing project, in Unity.
- Select Assets > Import Package > Custom Package... from the main menu, or by right-clicking in the Project window.
- Browse to the downloaded Tobii Pro SDK, named with TobiiPro.SDK.Unity.Windows.
- In the next dialog, select to import all files.
- In the project window, Drag and drop the "TobiiPro\VR\Prefabs[VREyeTracker]" prefab into the scene and in the inspector, select 'Subscribe To Gaze'.
- (Not required) Drag and drop the "TobiiPro\VR\Prefabs[VRCalibration]" prefab into the scene. Select the [VRCalibration] prefab and in the inspector, select a key to be used to start a calibration.
- Drag and drop the "TobiiPro\VR\Prefabs[VRSaveData]" prefab into the scene. Select the [VRSaveData] prefab and in the inspector, select a key to be used to start and stop saving data.
- Play the scene, the save data