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

Crash in OpenGaze while using Gazepoint G3 HD #101

Closed alisdt closed 5 years ago

alisdt commented 6 years ago

Hi,

I'm using a Gazepoint G3 HD from OpenSesame 3.1.9, with PyGaze updated to the latest version from github. Occasionally this crashes. The calibration display shows its feedback display (of left and right eye points), then if I hit space I get the error below in the Debug window. (Note that as the error suggests, I may have hit space to accept on a calibration with no points for one or the other eye -- at the moment I'm just playing around with the tracker).

Python 2.7.12

Starting experiment as ExperimentProcess-2 Expyriment 0.8.1.opensesame2 (Python 2.7.12) openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 1024 experiment.run(): experiment started at Fri Nov 10 15:31:07 2017 experiment.run(): disabling garbage collection experiment.end(): enabling garbage collection

Unexpected error

item-stack: experiment[run].new_pygaze_init[run] exception type: ZeroDivisionError exception message: float division by zero time: Fri Nov 10 15:32:13 2017

Traceback: File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 150, in run exp.run() File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 411, in run self.items.execute(self.var.start) File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 91, in execute self.run(name) File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 106, in run self[name].run() File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run self.experiment.items.run(_item) File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 106, in run self[name].run() File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\pygaze_init\pygaze_init.py", line 227, in run self.experiment.pygaze_eyetracker.calibrate() File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\libopengaze.py", line 461, in calibrate math.sqrt(sum(var['RX']) / float(len(var['RX'])))) / 2.0 ZeroDivisionError: float division by zero

esdalmaijer commented 6 years ago

Thanks for flagging this up! The problem seems to have occurred because no valid calibration points were recorded (e.g. because the GP3 couldn't detect your eyes). It requires some fixing on our end to make sure there isn't a hard crash when this occurs, but in the meantime you can fix it by making sure you're facing the screen and the GP3 can see your eyes.

esdalmaijer commented 5 years ago

Should be fixed with the latest commit, which fixes the GazePoint issues that I was aware of. Do let me know if it's still an issue! (Please open a new Issue thread if that's the case.)

EDIT: OOPS! It's actually only fixed in the drift check. However, it is now easier to redo the calibration, so hopefully the situation in which this bug occurs is much less likely to occur. Rule of thumb: Don't continue if your calibration is bad, as the above bug will only occur when no valid calibration points were collected.

akshay-salvi commented 4 years ago

can you please tell me how to get co-ordinates x and y from the pitch and yaw values that is theta and phi values