Dear community,
I am trying to setup Tobii pro to work in Psychopy 2022.2.5.
I have followed all the steps to use the Tobii pro eyetracker object (see code below) and I want to recover the x and y gaze coordinates to draw online eye positions in an extended display (which is setup as the main screen). Nevertheless, the output I am recovering for the x and y position is 0 (when I look to the screen, if I look out of the screen I get nans).
See here one sample output:
BinocularEyeSampleEventNT(experiment_id=0, session_id=0, device_id=0, event_id=1767, type=52, device_time=3931889794, logged_time=27.436136332980823, time=27.42369433300337, confidence_interval=0.0, delay=0.012441999977454543, filter_id=0, left_gaze_x=0.0, left_gaze_y=0.0, left_gaze_z=0, left_eye_cam_x=0.5655124187469482, left_eye_cam_y=0.5642527937889099, left_eye_cam_z=0.43369391560554504, left_angle_x=0, left_angle_y=0, left_raw_x=0, left_raw_y=0, left_pupil_measure1=2.994232177734375, left_pupil_measure1_type=77, left_pupil_measure2=0, left_pupil_measure2_type=0, left_ppd_x=0, left_ppd_y=0, left_velocity_x=0, left_velocity_y=0, left_velocity_xy=0, right_gaze_x=0.0, right_gaze_y=0.0, right_gaze_z=0, right_eye_cam_x=0.42657262086868286, right_eye_cam_y=0.5591907501220703, right_eye_cam_z=0.43298274278640747, right_angle_x=0, right_angle_y=0, right_raw_x=0, right_raw_y=0, right_pupil_measure1=2.99920654296875, right_pupil_measure1_type=77, right_pupil_measure2=0, right_pupil_measure2_type=0, right_ppd_x=0, right_ppd_y=0, right_velocity_x=0, right_velocity_y=0, right_velocity_xy=0, status=0)
I have also thought I need to create a display window in order to obtain gaze positions coordinates, but it did not work as well. Have any of you faced a similar problem? Could you share some functional code that I could test.
Thank you very much,
This is the code I am using to test the eyetracker.
from psychopy.iohub import launchHubServer
from psychopy.core import getTime, wait
from psychopy.iohub.constants import EventConstants
iohub_config = {'eyetracker.hw.tobii.EyeTracker':
{'name': 'tracker', 'runtime_settings': {'sampling_rate': 60}}}
#iohub_config = {'eyetracker.hw.mouse.EyeTracker': {}}
io = launchHubServer(**iohub_config)
# Get the eye tracker device.
tracker = io.devices.tracker
# Check for and print any eye tracker events received...
tracker.setRecordingState(True)
stime = getTime()
while getTime()-stime < 10.0:
for out in tracker.getEvents(): # check what the eventconstants do
print(out.left_gaze_y, out.left_gaze_x)