Problem with PyGaze Eyetracker
Hello everyone,
I am trying for the first time to build an eye-tracking experiment in OS. In my lab we are using Tobii Pro Fusion, that supports up to Python 3.10. Therefore I performed the following steps following the documentation attached:
- Created a virtual environment in Anaconda that works on Python 3.10 and installed OS and related packages in this environment. Documentation: https://osdoc.cogsci.nl/3.3/download#anaconda-cross-platform
- I then installed tobii_research in OS python console. Documentation:https://osdoc.cogsci.nl/3.3/manual/eyetracking/tobii/
- I started building my experiment using the available eye-tracking template (OS v4), however the pygaze_init is not working as intended. Thus I created an inline script to initialize and calibrate the tracker.
Inline Script
----------------------------
import tobii_research as tr
import time
# Find all connected eye trackers
trackers = tr.find_all_eyetrackers()
if len(trackers) > 0:
pygaze_eyetracker = trackers[0] # Use the first available tracker
print("Tobii Pro Fusion connected successfully!")
else:
print("Error: Could not find an eye tracker.")
pygaze_eyetracker = None
# Initialize calibration settings
if pygaze_eyetracker:
print("Starting calibration...")
try:
pygaze_eyetracker.calibrate()
time.sleep(5)
print("Calibration complete.")
except Exception as e:
print(f"Calibration failed: {e}")
-----------------------------------------------------------------------------------
However, when I run the experiment the following error(s) occurs:
Calibration failed: 'EyeTracker' object has no attribute 'calibrate'
File "C:\Users\f-eflamprou\.conda\envs\opensesame_p3_env\lib\site-packages\opensesame_plugins\pygaze\pygaze_drift_correct\pygaze_drift_correct.py", line 52, in prepare
self.experiment.pygaze_eyetracker. \
AttributeError: 'Experiment' object has no attribute 'pygaze_eyetracker'
I was wondering if you could assist me on this matter.
Finally, my last question has to do with storing eye-tracking data. Is this implemented via inline script or incorporated within the pygaze plugins? Any reading or previous discussion suggested would be a massive help!
Specs
Operating System: Windows 10
Python version: 3.10
Pygaze version: 0.8
OS: V4
Thank you in advance or your time and consideration.
Best regards,
Efi