Home Forums Software Development Problem in Running the Gaze Data Callback function

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8818
    Sajid Baloch
    Participant

    Hi, I am using Tobii Eye Tracker 4C (with license) and facing problem in running the gaze_data_callback(gaze_data) function using multiprocesssing in python 3.5.
    I am starting two processes, one of them, is running perfectly fine and the other one (gaze_data_callback) isn’t running.I am doing it like this:
    Multiprocessing:

        p1 = multiprocessing.Process(name="p1", target=gaze_data_callback)
        p2 = multiprocessing.Process(name="p2", target=test)
        p1.start()
        p2.start()

    Gaze data callback function:

    def gaze_data_callback(gaze_data):
            left_3d = gaze_data['left_gaze_point_in_user_coordinate_system']
            right_3d = gaze_data['right_gaze_point_in_user_coordinate_system']
            my_eyetracker.subscribe_to(tr.EYETRACKER_GAZE_DATA, gaze_data_callback, as_dictionary=True)
            time.sleep(5)
            my_eyetracker.unsubscribe_from(tr.EYETRACKER_GAZE_DATA, gaze_data_callback)

    Errors:

    Traceback (most recent call last):
    Name (It's OK if this is empty): 
      File "<string>", line 1, in <module>
    Process p1:
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
        exitcode = _main(fd)
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
    Traceback (most recent call last):
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 254, in _bootstrap
        self.run()
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 93, in run
        self._target(*self._args, **self._kwargs)
        prepare(preparation_data)
    TypeError: gaze_data_callback() missing 1 required positional argument: 'gaze_data'
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
        _fixup_main_from_path(data['init_main_from_path'])
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
        run_name="__mp_main__")
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 240, in run_path
        pkg_name=pkg_name, script_name=fname)
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 96, in _run_module_code
        mod_name, mod_spec, pkg_name, script_name)
      File "C:\Users\admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\Users\admin\PycharmProjects\SATracker\SATracker.py", line 9, in <module>
        my_eyetracker = found_eyetrackers[0]
    IndexError: tuple index out of range
    #8819
    Sajid Baloch
    Participant

    Is there any way to get the Tobii Tracker values (Gaze point and it’s timestamp) easily as array/tuple?

    #8820
    Sajid Baloch
    Participant

    I need the live data from Tobii EyeTracker 4C. Currently I am getting the data for a limited time. It gets the data for a time and then stops itself. Please provide a solution how can I get the data continuously while running other functions in parallel working on the same data.

    #8825
    Grant [Tobii]
    Keymaster

    Hi @greatdsa, thanks for your query. As you have stated that you have purchased the Tobii Analytics Licence which grants you usage of the Tobii Pro SDK in conjunction with the 4C Eye Tracker, then this entitles you for support with the Tobii Pro Business Department.

    Please kindly raise a ticket with Tobii Pro Support directly regarding this issue @ https://www.tobiipro.com/contact/support/ and they should hopefully be able to assist you as I am afraid I have not encountered this error before however they may have seen such a problem previously.

    Apologies for the inconvenience and good luck in resolution!

    #8847
    Sajid Baloch
    Participant

    Hi Grant,
    Thanks for your response. My problem was resolved.

    Now, I want to ask another question. Currently I am getting the gaze data using the callback function but I can not pass the value to another function. I want to make a lsit and save the gaze data I am getting from the eye tracker. For that, I need to pass the values outside the callback function but I am not being able to acheive it. Can you help in that?

    #8856
    Grant [Tobii]
    Keymaster

    Hi @greatdsa, apologies to bounce you back but I’m afraid we don’t currently offer support to the Python API of the Tobii Pro SDK on this channel. Please contact Tobii Pro Support who should be able to point you in the right direction. Thanks for understanding.

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