PyGaze Tobii problems, Titta implementation
Hi there,
I found OpenSesame with PyGaze has lots of temporal noise and missing samples with the Tobii eye trackers.
Diederick Niehorster helped me trace the bug and we also had contact with Edwin regarding this issue. We found libtobii to write the current system time at the time of writing the log file instead of the timestamp that is included in the sample of the eye tracker. This explains the high temporal noise. Additionally, it seems Python also has serious problems with multiprocessing and multithreading so lots of samples are lost.
I am now trying to implement Titta through inline scripts in an OpenSesame experiment.
Titta writes the correct timestamp but also uses a C++ wrapper TittaPy to stabilize the writing of samples to minimize the chance of lost samples. See: https://github.com/marcus-nystrom/Titta
I described the problem at PyGaze:
https://github.com/esdalmaijer/PyGaze/issues/173
I got Titta working in the inline scripts with only problem. The calibration dots are smaller and located more to the center. I found that Titta its calibration screen is created with psychopy with 'degree' as unit so it needs the screen distance and monitor dimensions. I am trying to get these monitor properties injected into OpenSesame by doing:
# %% Monitor/geometry var.MY_MONITOR = 'testMonitor' var.SCREEN_RES = [1920, 1080] var.SCREEN_WIDTH = 52.7 # cm var.VIEWING_DIST = 63 # distance from eye to center of screen (cm) var.mon = monitors.Monitor(var.MY_MONITOR) # Defined in defaults file var.mon.setWidth(var.SCREEN_WIDTH) # Width of screen (cm) var.mon.setDistance(var.VIEWING_DIST) # Distance eye / monitor (cm) var.mon.setSizePix(var.SCREEN_RES)
But I think this only creates a new monitor and does not change and apply it to the current monitor settings.
Is there a way to change and apply these values for the monitor created and used by OpenSesame?
Best,
Bob
Comments
Finally found it, you can just change the settings in ~/.psychopy3/monitors/testMonitor.json or create a new monitor there.
Now it works correctly!
I finished a Titta Eye Tracking plugin for OpenSesame. The latest version is in accordance with the new OpenSesame 4 plugin API. The plugin is also available for OpenSesame 3, this version is located in the 'legacy' branch. I tested it on Debian 12 (Bookworm) with the X3-120, Fusion and Spectrum.
https://github.com/dev-jam/opensesame-plugin-titta_eyetracking
Note: at the moment, the calibration item crashes in Windows because it wants to save the calibration images and data to a location where it has no write permissions. I am working on getting control over the location of these files. A workaround can be to calibrate with the Tobii Eye tracker manager and then omit calibration within OpenSesame. I have not tested this yet.
Titta is now independent of the psychopy monitor settings and the distance to screen. Calibration dots are drawn based on pixels (instead of visual angle) so no need to adjust testMonitor.json anymore.