Problem with Setting up Tobii Eye Tracker in OpenSesame
Hello everyone,
I hope you're all doing well. I'm currently facing an issue while trying to set up my Tobii Pro Spectrum eye tracker to work with OpenSesame, and I could use some guidance.
I followed the installation instructions provided on the OpenSesame documentation for Tobii eye trackers:
I'm running Windows 10 and using Anaconda for managing my Python environment. After successfully setting everything up, I attempted to run an eye-tracking experiment using the Eye-tracking template with Tobii as the tracker type. However, I encountered the following error:
Traceback (most recent call last):
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libqtopensesame\misc\process.py", line 134, in run
    exp.run()
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libopensesame\experiment.py", line 351, in run
    self.items.execute(self.var.start)
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libopensesame\item_store.py", line 89, in execute
    self.run(name)
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libopensesame\item_store.py", line 105, in run
    self[name].run()
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libopensesame\sequence.py", line 48, in run
    self.experiment.items.run(_item)
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\libopensesame\item_store.py", line 105, in run
    self[name].run()
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\opensesame_plugins\pygaze\pygaze_init\pygaze_init.py", line 196, in run
    self.experiment.pygaze_eyetracker.calibrate()
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\pygaze\_eyetracker\libtobii.py", line 306, in calibrate
    self.screen.set_background_colour(colour=(0, 0, 0))
  File "...AppData\Local\miniconda3\envs\opensesame-py3\lib\site-packages\pygaze\_screen\osscreen.py", line 271, in set_background_colour
    self.canvas.set_bgcolor(colour)
AttributeError: 'Psycho' object has no attribute 'set_bgcolor'
I'm using a Tobii Pro Spectrum eye tracker, and it appears that there's an issue with the background color setting in the PyGaze library. I've looked through the options in OpenSesame, but I can't find anything related to 'set_bgcolor'.
Has anyone encountered a similar problem, or does anyone have any suggestions on how to resolve this issue? Any help or advice would be greatly appreciated.
Thank you in advance!
 
				 
							 
							
Comments
Hi @SpacePenguins ,
Thanks for pointing this out! This looks like a bug due to PyGaze still relying on a function that no longer exists in OpenSesame 4.0 (and was deprecated a long time before). We'll look into it and fix this soon, but for now you may be able to fix this yourself by editing the offending file
osscreen.pyand commenting out line 271 (self.canvas.set_bgcolor(colour)).— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks @sebastiaan, I got it to work by commenting out set_bgcolor and set_penwidth.