Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Using Gazepoint GP3 HD with PyGaze and OpenSesame

morenomoreno Posts: 20

Hi there!

I have very recently bought a GazePoint tracker and I have been trying to test/use it with Opensesame and PyGaze. I have seen that PyGaze supports GazePoint (and that was also one of the main reason I decided to buy it).

I had a look at the page where @Edwin very kindly explains the use of his wonderful code, so I have tried to use it (attached an opensesame file with just that code fitted in).

I have already solved a couple of issues due to missing modules (lxml and pylink) as well as used the latest version of pygaze, which contains also the modification for using GazePoint.
It seems that I am almost there, but I have now hit a wall.
When trying to run the program, it is saying that:


Traceback:
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 102, in run
self.experiment.python_workspace._exec(self.crun)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\python_workspace.py", line 161, in _exec
exec(bytecode, self._globals)
Inline script, line 20, in
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\eyetracker.py", line 64, in init
from pygaze._eyetracker.libeyelink import libeyelink
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\libeyelink.py", line 29, in
from pygaze._eyetracker.eyelinkgraphics import EyelinkGraphics
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\eyelinkgraphics.py", line 44, in
custom_display = pylink.EyeLinkCustomDisplay

AttributeError: 'module' object has no attribute 'EyeLinkCustomDisplay'

I found other people discussing such issue online, and I have not clearly understood whether it is a problem of the version of pylink used, and if yes, which one I am suppose to use.

I thank you in advance for your kind support!

Moreno

Comments

  • morenomoreno Posts: 20

    ... just some follow up on things I did that have changed the problem slightly, although not solved my situation. I have downloaded the package pylink from SR Research Forum, because, apparently the one available on pip is not the correct one. I have copied it in the site-packages inside of OpenSesame. Now, when I run the code (provided above) I get this other error message:


    Traceback:
    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 102, in run
    self.experiment.python_workspace._exec(self.crun)
    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\python_workspace.py", line 161, in _exec
    exec(bytecode, self._globals)
    Inline script, line 20, in
    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\eyetracker.py", line 68, in init
    self.class.init(self, display, **args)
    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\libeyelink.py", line 158, in __init__
    "Error in libeyelink.libeyelink.__init__(): Failed to "

    Exception: Error in libeyelink.libeyelink.init(): Failed to connect to the tracker!

    what seems to be happening is that the eyetracker pygaze function is believing that the ET I am using is an SR, which is not .
    I am, in fact, specifying in the inline_script that:


    Display properties

    DISPSIZE = (1920, 1080)
    DISPTYPE = 'psychopy'

    Eye tracker properties

    TRACKERTYPE = 'opengaze'

    This is an example script to go with the above constants.py

    from pygaze.display import Display
    from pygaze.screen import Screen
    from pygaze.eyetracker import EyeTracker
    import pygaze.libtime as timer

    Initialise the Display and a Screen.

    disp = Display()
    scr = Screen()

    Show a waiting message.

    scr.draw_text("Preparing experiment...", fontsize=20)
    disp.fill(scr)
    disp.show()

    Open a connection to the eye tracker.

    tracker = EyeTracker(disp)

    Note, I am using the last version of pygaze, which allows for a gazepoint tracker:

    --

    if trackertype not in [u'dumbdummy', u'dummy', u'eyelink', u'smi', u'eyetribe', u'opengaze', u'tobii', u'tobii-legacy', u'tobiiglasses']:

    I have also tried to give as input

    tracker = EyeTracker(disp, TRACKERTYPE)

    but the PC crushes (i.e., it blocks and I have to reboot).

    @Edwin I am sure you are unbelievably busy, but I would truly appreciate any hint on solving this issue ... I bet if GP HD3 becomes a popular low-cost ET ... this post will be a useful guide to set it up.

    thanks a lot

  • i_vani_van Posts: 1

    Hi Moreno,

    we have also bought a GP3 for our lab and thanks to Edwin's help I got it running smoothly. I guess that the issue with your code is that you're not actually changing the trackertype to "opengaze" (even though you're defining the constant).

    If you're setting the constants in a separate constants.py file that is in the same folder as your .osexp file, don't forget to import the constants at the beginning of your script by using:

    from constants import *

    does it work now?

    Cheers,
    Ivan

  • morenomoreno Posts: 20

    Hi Ivan,

    thanks a lot for your response!

    yes, it was a problem about addressing the right eye-tracker, and I needed to modify the example script provided by Edwin such that:

    tracker = EyeTracker(disp, TRACKERTYPE)

    I also had to update psychopy to 1.85.3 and manually install the modules: future and json_tricks, to make it work. (I am using the latest release of Opensesame 3.1.9)

    Now, it did start the calibration, but it is definitely not going ok.
    (1) it only displays three points on the screen on the horizontal central line; even if, in the libopengaze.py script, the default should be 9 points [line 204-206].
    (2) it takes an incredible amount of time to start the calibration on the first place, and furthermore, the time between those three points is incredibly variable and unrealistically long.
    (3) when I get back the visualized accuracy for R and L eyes, the errors are quite huge, but when using the Gazepoint Controller software, the calibration looks reasonably ok. (so, it should not be something to do with the hardware).

    I was wondering ... would you be so kind to share here with me/us a very very simple opensesame "experiment" where we do an initial calibration, and record fixation data on 1/2 images at most? As you have a GP3 smoothly operating, it would be great if I could have a look at something that would work for you ... and see whether it does or it does not work for me.

    As side notes -- and looking inside the libopengaze.py script -- there are a couple of parameters of the calibration that I believe have to be manually adjusted:

    1) [line 147] self.samplerate = 60 -> I am tracking at 150Hz so this has to be changed right?

    2) [line 200] caldur = {'animation':1.5, 'point':1.5, 'timeout':10.0} -> whereby (if I understood it):
    - animation = the time in seconds that the calibration dot takes to move on the screen from one location to another location
    - point = the time in seconds that we spend collecting fixation samples at each location of the dot
    - timeout =the time in seconds between calibration points before giving up (?)

    is there anything else that you had to do to make it work? There are also several other parameters that may be tweaked in that script ... not sure what to touch though.

    The specs of my machine are:
    Windows 10 Home
    Processor: Intel Core i7-6600U CPU @ 2.6 GHz 2.81 GHz
    RAM: 16 GB
    System type: 64-bit operating system, x64-based processor
    Screen resolution: 1900x1080

    Thanks a lot in advance for any help!

Sign In or Register to comment.