Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Live Pupil Size Data

edited September 2021 in PyGaze

I'm using a Tobii eyetracker and would like to use live pupil size data.

I'm now doing this by setting a new variable to the pupil size like this:

var.ps = eyetracker.pupil_size()

I then print this variable in a sketchpad. However, when I run this, I get the error 'variable 'ps' doesn't exist'. To solve this, I initialized the variable ps to be 0 at the beginning of my experiment. Now, 'ps' is always 0. Why doesn't it update to the live pupil size?

I've also tried taking the pupil size at different time intervals and calculating the average, or only taking the pupil size if it's not -1 (and thus invalid), but neither of these methods are working. Any help would be appreciated!

Comments

  • edited October 2021

    Hi! I don't really have an answer, but I wonder if it has to do with the way you specify pupil_size: shouldn't you specify whether you mean left or right pupil size? Looking inside the libtobi.py, it says that pupil_size is a tuple. Maybe that's what's causing the issue?

  • Hi,

    If the value of the prespecified variable does not change throughout the experiment, it seems like this line

    var.ps = eyetracker.pupil_size()
    

    is never called. Are you sure that if you save it as var.ps you call it in a sketchpad as [ps] ? Also, if the pupil size is polled during the run phase, are you using a feedback item?

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.