Tobii and OpenSesame
Introduction
Tobii communication in OpenSesame can be achieved with the Titta plugin or the PyGaze library. The Titta plugin seems a more stable and easy to use option than PyGaze.
Using the Titta plugin
The Titta plugin implements the Titta library in OpenSesame. It is very easy to use and works well with Tobii. To install, run pip install opensesame-plugin-titta-eyetracking in OpenSesame. Then, restart OpenSesame. The Titta plugin objects are now available. A demo experiment can be found here: opensesame-plugin-titta_eyetracking/demo_experiment.
When you use Titta, make sure to cite it accordingly, see dev-jam/opensesame-plugin-titta_eyetracking.
The Titta library also provides examples for analyzing the gaze data (.h5 files). Make sure to follow the sample task and test out the whole analysis before starting data collection.
For analyzing pupil data, the PhysioData Toolbox can be used. The File Converter's Eye-Tracking TSV File Converter can be used to convert the tsv data files to PhysioData files.
See for more information on Titta:
- Tobii // OpenSesame documentation
- Titta OpenSesame plugin dev-jam/opensesame-plugin-titta_eyetracking
- Titta Python library: marcus-nystrom/Titta
Using PyGaze
PyGaze enables eye tracking with many eye trackers, including Tobii. PyGaze uses the Tobii Pro software development kit (SDK) to communicate with the Tobii eye tracker.
The PyGaze library is automatically installed with the OpenSesame Windows version. To work with Tobii, Python version 3.10 or 3.8 is required. For OpenSesame 4.0 and 3.3, OpenSesame can be run in its own Python 3.10 or 3.8 environment using Conda (see below). OpenSesame 4.1 does currently not work with PyGaze and Tobii.
More information on how to use PyGaze and a sample task can be found on our Github page and on the OpenSesame website.
Installing and Running OpenSesame Through Conda
Conda is a package manager included in Anaconda and Miniconda. Please make sure one of the two is installed before attempting to use Conda. It is preferable to install Anaconda as it provides a handy graphical user interface and more features, although those are not required. Note that both Miniconda and Anaconda can be installed for the current user without admin privileges by choosing “just me” at the “install for” prompt.
To run OpenSesame through Conda for the purpose of using Tobii, a new Python environment must be created and configured. Subsequently, the OpenSesame code and all its dependencies must be downloaded and installed inside that environment.
Once the environment has been set up, the OpenSesame installed inside of it can be launched by first activating that environment, then running the opensesame command.
The above has been automated in a few scripts, see Github for more information.
If you want to create your own environment, see Managing environments — conda 24.5.1.dev56 documentation for more information on Conda and see Download // OpenSesame documentation (cogsci.nl) for more information on how to download OpenSesame in a Conda environment.
FAQ
| Topic | Question | Answer |
|---|---|---|
| OpenSesame crashes with AttributeError: 'TobiiProTracker' object has no attribute 't0' | Make sure the eye tracker is connected properly to the pc and set-up with the Eye Tracker Manager. If this is the case, see below. Somehow, the eye tracker is sometimes not found immediately. This is usually resolved by just running the task again. See discussion and solution here. The find_all_eyetrackers() function needs to be adjusted to solve the issue. |