Gazepoint Control Version 4.2.0 used with PyGaze and Opensesame - Calibration Error
Hi there,
We have been using a GazePoint eyetracker with version 4.1 of the Controller, Opensesame 3.1.9, and the latest release of the PyGaze package on Windows 7 and Windows 10 machine without incurring into any major trouble. I have been helped by @moreno and @alisdt to set it up.
However, we wanted to update the Gazepoint Control to their latest release, which is 4.2.0. The reason is that it implements a new "P" mode for tracking difficult eyes, and we are often dealing with elderly and clinical populations which are actually harder to track.
But, when we try to run the Gazepoint Version 4.2.0, we got the following error during the calibration phase:
Starting experiment as ExperimentProcess-3
openexp._canvas.legacy.init_display(): enabling hardware surface
openexp._canvas.legacy.init_display(): enabling double buffering
openexp._canvas.legacy.init_display(): video mode ok
openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 1024
openexp.sampler._legacy.init_sound(): mixer already initialized, closing
experiment.run(): experiment started at Thu May 31 15:06:43 2018
experiment.run(): disabling garbage collection
Exception in thread PyGaze_OpenGazeConnection_incoming:
Traceback (most recent call last):
File "C:\Program Files (x86)\OpenSesame\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Program Files (x86)\OpenSesame\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\opengaze.py", line 428, in _process_incoming
command, msgdict = self._parse_msg(msg)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\opengaze.py", line 350, in _parse_msg
e = lxml.etree.fromstring(xml)
File "src\lxml\etree.pyx", line 3213, in lxml.etree.fromstring
File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src\lxml\parser.pxi", line 1764, in lxml.etree._parseDoc
File "src\lxml\parser.pxi", line 1126, in lxml.etree._BaseParser._parseDoc
File "src\lxml\parser.pxi", line 600, in lxml.etree._ParserContext._handleParseResultDoc
File "src\lxml\parser.pxi", line 710, in lxml.etree._handleParseResult
File "src\lxml\parser.pxi", line 639, in lxml.etree._raiseParseError
XMLSyntaxError: attributes construct error, line 1, column 30 (line 1)
@moreno and I suspect that in this latest 4.2.0 of the Gazepoint Control, something in the API must have been changed and consequently PyGaze cannot parse the XML.
As we really are not that familiar with the implementation of PyGaze, we would have to ask PyGaze experts here, as well as you @Edwin, whether you have encountered a similar problem before; and especially whether you would be so kind to help us resolve this issue.
Thank you very much for your precious time.
Comments
Heya!
Thanks for the elaborate description and for posting the full traceback, those are very useful! I hope you don't mind, but I changed your post ever so slightly by putting the traceback info between
~~~
flags to make it render as code. This makes it slightly more readableAs for the actual issue: It sounds like your analysis is correct. I haven't tried the new API yet, so haven't run into the issue myself, but your error message is from the
lxml
library (which is native Python; not something that we concocted!), and seems to indicate that the xml message that it tried to parse was malformed. For example, this can happen when a space is missing from the message, or a closing quotation is forgotten.Whether this malformed message came directly from the GP tracker is something that is hard to say. It could well be, but it could also be that the message was partly lost along the way someplace. One thing you could try is to ask GazePoint about this specific point, as they will know whether they might have changed anything that could have introduced malformed xml.
In the meantime, if I have some time (which is not likely to be very soon - especially not this week or the next), I'll have a look at whether I can reproduce the error, and whether I can find a workaround.
Good luck!
Edwin
Hi there,
we have been in touch with Gazepoint developers and apparently, a potential source of conflict was that in Gazepoint 4.2 there was a bug
Basically, a missing space ...
So, they gave us today an updated version (4.3) to be released very soon wherein such bug was fixed.
I do not know whether that was the true cause of the problem, but we seem now to be able to track just fine using PyGaze and Opensesame, and their latest 4.3 version ... so, at least for now ... problem solved!
Moreno
Hi Moreno,
Amazing, thanks for the update! That missing space is very likely to have been the cause of the
lxml
hickup, as it would fail to understand thatVALUE="0"DUR="0"
actually meansVALUE="0"
ANDDUR="0"
.Cheers,
Edwin
PS: I totes called it
Hi all,
I am posting in this thread rather than creating a new one because I suspect it is a similar issue. In both Gazepoint 4.3 and the new 5.1 release, I encounter this error at the pygaze_init object (with opengaze selected as the tracker). I'm using Windows 10 with OpenSesame 3.2.5.
If you suspect it's another bug in the Gazepoint API, I will follow up with them.
Thanks all! And special thanks to @Edwin for adding Gazepoint to PyGaze and keeping the dream of cheap eye tracking alive
Tom
Hi Tom,
Good to see you here! Thanks for flagging this up. It's due to a bug (malformed xml) in the GazePoint API. There are two workarounds:
1) You can ask GazePoint for a pre-release of their API, which had the bug fixed.
2) We built a workaround into PyGaze, I just forgot to put it on GitHub. Will upload it first thing tomorrow!
EDIT: Actually, on closer inspection, it seems like this is a slightly different error that I'm used to! (Don't worry, you'll also run into the above error in time ) It seems like for whatever reason, the
lxml
library isn't installed. You can install it using the following command in a terminal:Alternatively, within OpenSesame, you can run the following in the Debug Window:
Cheers,
Edwin
UPDATE: The GazePoint OpenGaze API malformed XML bug should be fixed with the latest commit. Grab the code of GitHub directly, and update your local PyGaze installation with it. See here: https://github.com/esdalmaijer/PyGaze
Thanks Edwin! I'm looking forward to using the GP3 I think I'm almost there. I ran that code in the debug window in OpenSesame, and here is what happened:
I have admin privileges, so not sure what the issue is. I tried it through my command prompt with the other code and got this error:
'pip' is not recognized as an internal or external command,
operable program or batch file.
Is my windows command prompt different than the terminal you had in mind? (Pardon my cluelessness/helplessness!) I tried the Python 3.4 command line, too, but no luck.
Perhaps it was premature, but I moved on and replaced the opengaze.py and libopengaze.py files in my pygaze folder (within my OpenSesame folder) with the new versions on GitHub. Then I tried running OpenSesame with Opengaze as the tracker type and got this error:
Thanks for any advice you have!!
About pip in your command window: you probably need to add the path of your pip installation to the
path
system variable. Find the path to your pip. It will probably be in a folder like "C:\Python\Scripts", which is what I will use below as an example.Open your command window in your python folder (probably; I don't have much experience with python and windows) and type
echo %PATH%
. If the folder containing your pip installation is note there, you can add it withsetx PATH "%PATH%; C:\Python\Scripts"
. Since this is Windows, you might have to restart your cmd window for any changes to take effect.About your second issue; if you download from git rather than clone, I noticed that one might run into formatting inconsistencies. Simply open the downloaded file in an editor and remove anything at the top that's not Python.
Thanks cesco! As you suspected, I did the GitHub download wrong. Now I am back to the 'No module named lxml.etree error'. So I just need to get the lxml library installed, which I will now try with your advice regarding the path...
I was able to install lmxl from the debug window once I ran OpenSesame as an administrator. Now I'm all set! Thanks everyone for your help! Very cool to see how the Gazepoint calibration routine plays out in PyGaze/OpenSesame!
Great to hear, Tom!
Hi all, I am new in eyetracker and got a lot of help in this forum. Thanks for amazing contribution in making Gazepoint GP3 works. Such a great elaboration. I tried from very basic and follow the step from this thread. I got a lot of errors but finally GP3 runs with no problem, however it take a several time (that I think lagging or error) to load 9 point calibration. I use Win 7, Win 8 and Win 10 respectively. Also, pylink only work with 32 bit, so if you use psychopy you have to change the OS with win 7 32 bit. From all these OS, only win 7 32 bit could outperformed with no error (as Edwin suggest it in his book). This is what I collected from this forum and work for me:
Gazepoint work around with PyGaze and OpenSesame
1. Start Opensesame with run as administrator
2. Make sure Opensesame in latest version with PyGaze 06.0a25
3. Add pip path (C:\Python27\Scripts)
4. Continue with import pip and start install lxml modul with pip.main(["install", "lxml"]). After the instalation is complete, restart opensesame.
5. In pygaze_init change the dummy to opengaze
6. Done
Hello!! my name is Camila, I am trying to recreate an OpenSesame experiment using the gazepoint GP3 eye tracker.
The Opensesame version is 3.3.12, Python is 3.7.6. I am having a problem similar to the ones presented above. I will show it, however nothing seems to work, I've tried the recomendations presented here, also I've updated the opengaze.py, and libopengaze.py codes with the latest github version, updated the last pip version, try to move the folders, etc.
I will tremendously appreciate any advice/solution in other to recreate the experiment with the eye tracker.
Thanks,
Regards,
Camila