Home Forums Software Development Gaze data callback function not triggering in Python

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #23584
    Nav D


    I just got my eye tracker 5 and i am trying to access the gaze data from the device. I have installed tobii_research package and i can detect the device without issues.
    However, my gaze_data_callback function does not trigger after subscribing to EYETRACKER_GAZE_DATA

    The print logs should fire from within gaze_data_callback(gaze_data) but the output that i get is :

    Found 1 eye tracker(s).
    Attempting to subscribe to gaze data of eye tracker: <tobiiresearch.implementation.EyeTracker.EyeTracker object at 0x0000019A58E1AB60>
    Successfully subscribed to gaze data.
    Has anyone had this issue?

    Below is my code.

    import tobii_research as tr
    import time

    def gaze_data_callback(gaze_data):
    print(“Gaze data received.”)
    left_eye_point = gaze_data[‘left_gaze_point_on_display_area’]
    right_eye_point = gaze_data[‘right_gaze_point_on_display_area’]
    print(f”Left eye gaze point: {left_eye_point}”)
    print(f”Right eye gaze point: {right_eye_point}”)

    eyetrackers = tr.find_all_eyetrackers()
    if not eyetrackers:
    print(“No eye trackers found.”)

    print(f”Found {len(eyetrackers)} eye tracker(s).”)
    my_eyetracker = eyetrackers[0]

    print(f”Attempting to subscribe to gaze data of eye tracker: {my_eyetracker}”)
    my_eyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, gaze_data_callback)
    print(“Successfully subscribed to gaze data.”)
    except Exception as e:
    print(f”Failed to subscribe to gaze data: {e}”)

    print(“Press Enter to exit…”)
    while True:
    except KeyboardInterrupt:

    print(“Unsubscribing from gaze data.”)
    my_eyetracker.unsubscribe_from(tr.EYETRACKER_GAZE_DATA, gaze_data_callback)

    Grant [Tobii]

    Hi, the tobii_research package SDK is only for Tobii Pro Eye Trackers. The Tobii Eye Tracker 5 only interfaces with the Stream Engine API for which you can make a request for access @ https://developer.tobii.com/software-downloads/

    Nav D

    Thanks for the reply.
    So is there any Python wrapper for stream engine api ?
    Or C++ is the only option if you want to work with Gaze data from eye tracker 5?

    Nav D

    Also although i have already requested the stream engine api through your provided link, how long do i typically need to wait before i can access it ?

    Grant [Tobii]

    Hi Nav, please send me a PM with the email you used to register interest and I will check it for you.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.