esdalmaijer / PyGaze

an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments
www.pygaze.org
GNU General Public License v3.0
671 stars 211 forks source link

Tobii Pro Eyetracker sampling rate issue : gaze and pupil data are sampled at different rates. #113

Closed RoelvanDooren closed 6 years ago

RoelvanDooren commented 6 years ago

Hello there,

I'm experiencing some problems with the rates at which gaze and pupil data are sampled. I'm using a Tobii Pro Eyetracker which samples at 120Hz. The gaze data is, as expected, properly recorded every 8.33 ms. However, for some reason I don't understand, the pupil size data is only sampled at 40Hz.

What I noticed is that, whenever I print the callback on line 201 in libtobii.py (self.eyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, self._on_gaze_data, as_dictionary=True), pupil data is only recorded every 25 ms. Interestingly, the PupilValidity parameters appear to be correctly updating on each sample. (See below for an example).

I already contacted @esdalmaijer, he suggested me to forward my issue to @grebdems and @pedrotari7 . Perhaps you guys are able to help me figure this out?

Thanks in advance and kind regards,

Roel

Roel van Dooren, MSc. | PhD Candidate | Institute of Psychology | Cognitive Psychology Unit & Leiden Institute for Brain and Cognition | Leiden University | Office: Pieter de la Court 2B19, Wassenaarseweg 52 | 2333 AK Leiden, the Netherlands | Phone: +31 (0)71 527 6869


Output:

TimeStamp Event GazePointXLeft GazePointYLeft ValidityLeft GazePointXRight GazePointYRight ValidityRight GazePointX GazePointY PupilSizeLeft PupilValidityLeft PupilSizeRight PupilValidityRight

388.0720 870 697 1 770 671 1 820 684 3.6104 1 3.7911 1 396.3880 901 707 1 811 677 1 856 692 -1.0000 1 -1.0000 1 404.7270 921 715 1 826 682 1 874 698 -1.0000 1 -1.0000 1 413.0660 927 740 1 822 676 1 875 708 3.7689 1 3.6716 1 421.3630 928 712 1 819 678 1 874 695 -1.0000 1 -1.0000 1 429.6880 927 713 1 825 677 1 876 695 -1.0000 1 -1.0000 1 438.0310 926 708 1 832 675 1 879 691 3.6529 1 3.8240 1 446.3720 934 708 1 838 678 1 886 693 -1.0000 1 -1.0000 1 454.6720 928 705 1 842 674 1 885 689 -1.0000 1 -1.0000 1 463.0040 924 710 1 843 665 1 884 687 3.6660 1 3.8323 1