Sample Code for Tobii Eyetracker?

649 views
Skip to first unread message

Maria

unread,
Oct 18, 2013, 5:16:40 PM10/18/13
to psychop...@googlegroups.com
I am conducting a reaction time experiment and I want to use a Tobii T120 eyetracker to collect eye gaze and pupillometry data.

Now, I have read the SDK manual several times and I got the sample codes from the SDK (EyetrackerBrowser.py and SyncWatcher.py) to run; but I still don't know how to implement the eyetracker code into the experiment code. For example, I don't know how to call the eyetracker once the computer has connected to it to start collecting data; I don't know how to run the calibration; I don't know how to save the data; I know the names of those commands, they are all listed in the SDK handbook, but I don't know how to use them, especially in connection with the EyetrackerBrowser that is supposed to create an eyetracker object once it connected to the eyetracker - of this eyetracker object again I don't know the name ...

What I think I really need is just any example code from any experiment, that shows how to use the Tobii commands to get eye gaze data and pupillometry data.

Thank you so much!

Sol Simpson

unread,
Oct 19, 2013, 6:05:31 PM10/19/13
to psychop...@googlegroups.com
Hi Maria,

I would suggest you use the psychopy.iohub module, which includes support for eye tracking devices including the Tobii. 

Demo coder scripts can be found in:
  • psychopy.demos.coder.iohub_extended.eye_tracker folder. Run by:
    1. Open the run.py file in the eye_tracker  directory with a python IDE and run the script, or start the script from a command window using the usual "python run.py".
    2. A dialog should appear asking you to select the eye tracker you want to use. Select 'Tobii'. 

  • psychopy.demos.coder.iohub_extended.gc_cursor.  (In the latest source on github only). For this example:
    1. replace the iohub_config.yaml in the demo source with the one I have attached to this reply, which has been changed to use the Tobii eye tracker by default.
    2. Open the run.py file in the gc_cursor directory with a python IDE and run the script, or start the script from a command window using the usual "python run.py".

There is also a PsychoPy Builder example that uses a custom code component to add the ioHub Eye Tracking Device Interface logic at:
  • psychopy.demos.builder.iohub.stroop_eyetracking. To run this:
    1. Start the PsychoPy2 Builder Application
    2. Open the 'stroop.psyexp' file in the stroop_eyetracking folder.
    3. Run the project.
    4. When an input dialog appears at the experiment start, enter 'tobii_std.yaml' in the field labelled "Eye Tracker".
    5. Press 'OK' and the demo should run.
Docs for ioHub are currently here. Information on the eye tracking device is here; and Tobii implementation details are here.

Let me know if you have any questions.

Thanks,

Sol

Sol Simpson

unread,
Oct 19, 2013, 6:07:10 PM10/19/13
to psychop...@googlegroups.com

Sorry, the attachment mentioned in my first reply is attached here. ;)
iohub_config.yaml
Reply all
Reply to author
Forward
0 new messages