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

Issue with initial menu on OpenSesame #94

Open EoinTravers opened 7 years ago

EoinTravers commented 7 years ago

I'm using pygaze 0.6.0a21, within OpenSesame 3.1.6, with an EyeLink 1000 Plus tracker. My issues arises when I initialize the tracker (using the OpenSesame plugin), press Enter to see the image from the tracker, and press left or right until I reach the zoomed-out image of the participant's face (the tracker is set to Desktop (Remote Mode), Monocular, using a target sticker, although I don't think that's relevant).

On Windows 10, the experiment still works, but the following exception is raised repeatedly (many times a second):

Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\eyelinkgraphics.py", line 387, in get_mouse_state
    button, pos, time = self.mouse.get_clicked()
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_mouse\osmouse.py", line 118, in get_clicked
    return button, self._from_pos(pos), t
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_mouse\osmouse.py", line 67, in _from_pos
    return pos[0]+self.mouse._xcenter, pos[1]+self.mouse._ycenter
TypeError: 'NoneType' object has no attribute '__getitem__'

On Ubuntu, however (I will check the OS and pygaze version later), the experiment freezes hard at this point, and the only way to regain control of the computer is to log in to a new session without the GUI, and shutdown the machine from there. I presume this is due to the same error occuring, but not being ignored gracefully on Ubuntu.

I know a quick fix would be to comment out the line in eyelinkgraphics.py in question, since I don't need to use the mouse at this point, but I'm unlikely to have time to get to the root of why this happens over the next week or so.

smathot commented 7 years ago

Thanks, I'm going to take a look at this. The logic in the code does look flawed to me, but I don't understand why this happens to you, whereas I've never experienced this with the same code. Could you help us out by trying a few things?