Tobii Technology is a well-known company producing eye-trackers. One of their advantages that they support the Linux operating system, which PsyToolkit runs on.
Supported models
PsyToolkit can run using the following eye-tracker models: Tobii X60, Tobii X120, Tobii T60, Tobii T120, Tobii T60 XL, Tobii TX300, Tobii X1 Light, Tobii X2-30 and Tobii X2-60.
Models that are not supported are: Tobii 1750, Tobii X50, Tobii 2150, Tobii 1740 (D10), Tobii P10, C-Eye, PCEye, Tobii IS-1 and Tobii Rex.
PsyToolkit code has been developed using a TX300 (displayed above). |
Setup and installation
What you need
-
One of the supported Tobii eye-trackers
-
A Linux computer. Not all Linux versions might support the Tobii Analytics libraries (see below)
How to install the Tobii software on your system
Step 1: Go to the Tobii Analytics SDK website and select download.
Tobii suggests to work with Ubuntu 12.04 (LTS), but it also works on Ubuntu 16.04 or Mint 18, which are of course newer and much better. The PsyToolkit Tobii library is developed using Mint 18. |
Step 2: Unpack the Tobii Analytics zip file as follows:
untar --- ----
Step 3: Copy some of the files to the right locations on your Linux system (the Tobii package does not do this for you!).
cp --- ----
Step 4: Now run the PsyToolkit install for Tobii. Do the following.
-
Install PsyToolkit the normal way to make sure you have all required software packages installed.
-
Type the following
cd /tmp/psytoolkit_src
sudo ./install.sh -t
The -t option in the install makes sure the Tobii libraries are installed. |
Connect the Tobii eye tracker to you Linux computer
The Tobii eye tracker is connected using the internet cable. There are different ways to do this. The cable goes simply from the eye-tracker to the Linux computer.
In your network manager dialog (see image below), make sure you set the connection mode to "Link-Local only", otherwise, the connection might not be established.
This means that you then have no internet (of course, you can use a separate connection for internet). For example, if you are in university, you can use your mobile phone to connect to your local university wifi and then connect with a USB cable to your Linux computer (on Android, switch on USB tethering). Mint Linux will automatically recognize this setup. |
Test if the eye tracker works on your Linux computer
The Tobii Analytics packages comes with working Linux software to test your eye-tracker. It is best to see if that works first. Only if that works, you should continue.
They provide two test packages. Out of the box, I could only compile one of them, the other one had an error in it, which I could fix easily.
=⇒ image of file folder with the working package
Test PsyToolkit scripts
Now you are set to test if PsyToolkit works with Tobii. Make sure you have switched your eye-tracker on.
1) Copy the Tobii example to your HOME directory:
cp -p -r /usr/share/doc/psytoolkit/2.2.1/examples/tobii ~/
2) Compile the script
psycc -t tobii-test.psy
3) Run the script
./experiment
Tobii commands in PsyToolkit explained
Now that you have everything running, it is time to explain the Tobii commands in PsyToolkit.
option tobii
If you want to use the eye-tracker, you need to add tobii to your options. Once you have that option, PsyToolkit will assume that only one eye-tracker is connected and it will connect to that one.
options
et tobii
Calibration
It is assumed that every experiment you run starts with a calibration. In your block section, you can add a tobii calibrate line to the first block section.
block block1_of_my_study
et calibrate
tasklist
my_task 10
end
Check if someone looks at a stimulus for some time
You typically will want to make sure people look at the fixation point at the beginning of your task. In essence, people need to "hold" their gaze at the fixation point for some time. You can use the tobii hold command.
In the example below, we show one stimulus (fixpoint), which is thus stimulus number 1. Then we tell Tobii that the participant needs to hold this stimulus number 1 for 3000 ms. People get up to 10000 ms (10 secs) to look at the stimulus and fix it. For example, it might take someone 1 second to move their gaze to the fixpoint, and then when they hold it, they might not hold it, etc. For the whole process, they get more time than the hold time itself. You can set this number as high as you want, of course. But if it is too high, people just might have some issue or the fixpoint might be too small (see tobii allow to deal with this).
task my_task
show fixpoint # stimulus 1
tobii hold 1 10000 3000
Thus, the command syntax can be described as such:
tobii hold stimulus_number total_time_for_this time_to_old_in_ms
Note that the computer sticks to the tobii hold command. In other words, it does not go on until people have held the stimulus.
Check if someone looks at a stimulus
Similar to functions to check is someone presses a button within a certain time, we can ask if someone looks at as a stimulus.
In the example below, we build on the example above. After the fixpoint, we add my_stimulus, which is stimulus number 2. We simply do a tobii look 2 3000 to tell Tobii that the computer should wait for up to 3000 ms until participant looks at the stimulus. The response time will be stored in EYE_RT.
task my_task
show fixpoint # stimulus 1
tobii hold 1 10000 3000
clear 1
show my_stimulus -400 0 # stimulus 2
tobii look 2 3000
save EYE_RT
Stimuli too small to get good results?
In the above, the stimuli might be too small to accurately check if people look at them. This can be an issue given that there is "noise" in the eye location signal. You can widen the window around stimuli. For this we use the tobii allow command. It specifies the number of pixels around the stimuli.
Thus, if your stimulus is 10 pixels wide and 10 pixels high, you might find that people cannot hold their fixation on it. But with tobii allow 100 this would allow a size of 110 pixels wide and 110 pixels high.
task my_task
show fixpoint # stimulus 1
tobii allow 100
tobii hold 1 10000 3000
clear 1
show my_stimulus -400 0 # stimulus 2
tobii look 2 3000
save EYE_RT
Show where they eyes look at on screen
During testing, following calibration, or during instructions for participants, it is nice to show where people look at. You can display the eye-gaze position on screen on top of your stimuli. This technique is used in the tobii_test example as well.
In your task, or in the block, you just use the command tobii display eyes. You can stop this PsyToolkit feature with tobii hide eyes.
task my_task
show fixpoint # stimulus 1
tobii allow 100
tobii display eyes
tobii hold 1 10000 3000
tobii hide eyes
clear 1
show my_stimulus -400 0 # stimulus 2
tobii look 2 3000
save EYE_RT
task my_task
show fixpoint # stimulus 1
tobii allow 100
tobii hold 1 10000 3000
clear 1
show my_stimulus -400 0 # stimulus 2
tobii look 2 3000
save EYE_RT
or in block
block test
tobii calibration
tobii display eyes
tasklist
my_task
end