![]() ![]() One downside of using the Tobii Pro SDK to record data is that you only get access to the raw data. # When done, close the file handle and set the variable back to None # The filename should be different each time so that it doesn't overwriteĮyetracker_datastream = open('eyetracker_data.csv', 'w') # If data is needed in the experiment, use the following code # Variable for creating file handleĮyetracker_datastream.write(gaze_data) If it is not set to None, I know that it is now a file handle and I can write incoming samples to this file stream. In the callback function, I refer to the global eyetracker_datastream variable. As soon as I have completed data collection I set this variable back to Noneģ. In the experiment, whenever I need to record data I create a file handle using the eyetracker_datastream variable. Define an eyetracker_datastream variable, which I initially set to None.Ģ. To save eye tracking data to a file, I used the following approach:ġ. After inspecting the content of the gaze_data variable, I decided to retain the following keys: device_time_stamp Using the above code, the gaze_data variable in the callback function will contain a lot of data for each sample. import tobii_research as trĮyetracker_address = 'tobii-prp://TPFC2-010200146384'Įyetracker = tr.EyeTracker(eyetracker_address)Įyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, gaze_data_callback, as_dictionary=True) I found this a useful option because I could not find a good overview of the actual data that you get for each sample. ![]() Optionally you can configure that the values in each data sample are coded as a dictionary. To collect data, you have to subscribe to the EYETRACKER_GAZE_DATA and provide the name of the callback function that you defined. When setting up the eyetracker, the eyetracker is first defined using its address (which can be found in the Eye Tracker Manager). This is a function that has the following signature: def gaze_data_received(gaze_data): To collect data, Tobii requires that you define a callback function. The documentation on the Tobii website is an excellent resource with many examples that help you get started. ImportError: DLL load failed while importing tobii_research_interop: The specified module could not be found. This lead to the following error when trying to import the Tobii modules (which was resolved by reverting to Python 3.6.12):įrom 3 import tobii_research_interop When setting up a computer for an experiment I always start with a fresh intallation of all the tools, which means my Python version was 3.8.5. The only thing that took me a while to figure out (probably because I did not read the Tobii documentation properly) is that the Tobii modules are not compatible with Python versions > 3.6. The tobii_research_addons module can be used to validate calibration results. ![]() The tobii_research module is used to collect data from the eyetracker. Tobii has developed two modules (part of the Tobii Pro SDK) that greatly facilitate the work of interacting with the eyetracker. Overall, this was not too difficult to achieve. Since we had already programmed the experiment in PsychoPy (using the Anaconda Python distribution with PsychoPy installed as a module), we planned to use the eyetracker from within Python. This can be used to design experiments that use the eye tracker. In addition, it provides an intuitive interface that allows you to quickly callibrate new participants.įigure 2: After configuring the eye tracker we are ready to go! Using the eyetracker in PythonĪlthough I have not used it myself, Tobii offers another software tool called Tobii Pro Lab. This is a convenient software tool that allows you to configure in combination with the system that you are using. The latter is needed because older USB ports are not able to deliver the power needed to operate the eye tracker.įigure 1: The Tobii Pro Fusion Tobii Pro Eye Tracker Managerīefore you can use the eye tracker on your computer, you need to install the Tobii Pro Eye Tracker Manager. If you do not have a USB-C port, the package also contains a USB adapter as well as a power cable with different power socket adapters. If you have recent computer with a USB-C port, all you have to do is connect the eyetracker and you are ready to go. The past few days I got the opportunity to unpack and set up an experiment with the new Tobii Pro Fusion eye tracker! The eye tracker is delivered in a nice looking case that also contained several magnetic plates that can be attached to a computer monitor. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |