psychopy.org | Reference | Downloads | Github

Doing Drift Correction with ioHub

OS (e.g. Win10): Windows XP
PsychoPy version (e.g. 1.84.x):
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: drift correction at the beginning of every trial (ideally a central fixation cross is displayed, the participant clicks it, and this sends drift correction information to the eyetracker. I’ve already set up a central fixation cross which the participant clicks, but I can’t get drift correction to begin)

What did you try to make it work?: added a code module to the routine for the central fixation which says under “Begin Routine”: eyetracker.sendCommand(‘doDriftCorrect’, [0, 0, 1, 0]). The third argument is 1 for now because I’m having trouble getting drift correction to start at all, and wanted visual feedback while testing if it started working. “eyetracker” is defined in a code module of the trial routine under “Begin Experiment” as: eyetracker=io.getDevice(‘tracker’).

What specifically went wrong when you tried that?:
I get the following error every time the fixation routine begins:
<type ‘exceptions.AttributeError’>
AttributeError("‘module’ object has no attribute ‘getEyeLink’",)
[’ File “C:\Program Files\PsychoPy2\lib\site-packages\psychopy\iohub\devices\eyetracker\hw\sr_research\eyelink\eyetracker.py”, line 1469, in _doDriftCorrect\n r=pylink.getEyeLink().doDriftCorrect(x,y,draw,allow_setup)\n’]

EDIT: The issue was that the function is supposed to be getEYELINK not getEyeLink. I changed it in ioHub’s eyetracker.py and that resolved the issue.