Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] gazepoint eye tracker - get TCP/IP stream into opensesame data output

MARMAR
edited April 2014 in OpenSesame

Hi There! Great work on the program and forum. I've haven't seen a post regarding how take a data stream from a socket and place it into the opensesame data output. I'm familiar with how to create a variable that shows up in the data file...
so far i've been able to connect to the socket. the 'open gaze' API (http://gazept.com/Publications/Gazepoint_API_v2.0.pdf) provides a great functionality so that I can call the device with little trouble... but how to take a 60hz stream within opensesame, and log it with the data for analysis, this is where i have stalled and could use some advice!

thanks so much for any help!
Martin

import socket
import sys

#create TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

#connect socket to the port 
server_address = ('127.0.0.1', 4242)
print 'connecting to %s port %s' % server_address
sock.connect(server_address)

Comments

  • edited 3:41AM

    Hi Martin,

    If you want to log continuous data to the OpenSesame logfile, you're best off not using a logger item (which creates a spreadsheet-like format) and writing the data yourself using self.log() in an inline_script. For example ...

    for i in range(3):
        self.log('This is number %d' % i)
    

    ... will give a log file like ...

    This is number 0
    This is number 1
    This is number 2
    

    See also:

    But I'm not sure whether this is your main question, or whether you have trouble retrieving the data from the GazePoint tracker in the first place? If the latter is the case, you're better off first asking the manufacturer if they can provide you with some working Python code. Once you have this, we can see how you can incorporate this into OpenSesame, which shouldn't be too difficult.

    Cheers,
    Sebastiaan

  • edited 3:41AM

    Hi Mar (and Sebastiaan),

    I'm looking to do something similar with the Gazepoint GP3 eye tracker. Were you able to make any headway with Sebastiaans answer? I am wondering how would you continually log data from the eye tracker, whilst presenting a stimuli? I am guessing you would run an inline script in parallel to the stimuli (e.g. sketchpad item) and have it poll the eye tracker and log the received data? E.g. in pseudo code the script would basically say "while 1: poll the eyetracker, write the data to the log", but would stop when the stimuli was no longer displayed.
    So, I'm wanting to only grab the eye tracker data during trials, rather than continually.
    I hope this makes sense - please let me know if you have any thoughts.

    TIA,

    Neon

  • edited 3:41AM

    OK, maybe I should have waited before posting the above, as I've had a crack at getting the Gazepoint working with Opensesame. I've done more or less what I mentioned above and it seems to work, but I'm concerned its maybe very inelegant or worse...

    I've created a global variable to flag when the eyetracker should be recording. The experimental trial runs parallel (in a parallel item) with an inline script that polls the eye tracker continuously whilst the previously mentioned flag is true. When the experimental trial is finished (e.g. a key has been pressed), another inline script (below the keypress event) sets the global flag to zero. This stops the recording (and writing the x,y and time co-ordinates to the log file via self.log().

    Is there a better way to run the script to collect the eye tracking data for an arbitrary period of time? Does what I have done make you want to physically vomit? If so, and you have a superior / safer way of doing this, I would be really grateful if you could let me know.

    Also, to try and record timing for the eye tracker data relative to logging data from the keypress event, I've used another global variable that records the time at the start of the trial. Again, I suspect this is quite a crime.

    Let me know your thoughts, and many thanks in advance.

    Neon

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games