Howdy, Stranger!

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

Supported by

Pygaze dummy mode not working (even with code from the book)

Whenever I try to test things out in dummy mode--even when I try using code straight from the pygaze creator's book--I get this error:

Exception: Error in libeyelink.libeyelink.__init__(): Failed to connect to the tracker!

I've tried just about every permutation of DUMMYMODE=True, TRACKERTYPE="dummy", and TRACKERTYPE="dumbdummy". I've tried setting trackertype to Tobii with dummymode=True. And yet it always seems to try to call eyelink. I've tried looking through the pygaze documentation in case the functions need updating (since the book is from 2016), but I haven't found anything.

By the way, I'm doing this using psychopy coder as my shell (haven't tried using builder at all). All the other code from the book has worked great within psychopy.

Please let me know if me posting the whole traceback would be helpful--its long. As for what I'm trying to do with my own experiment, I'm trying to test a saccade-contingent paradigm with my cursor. But of course the first step is to getting it to run in dummymode at all.

Any help would be much appreciated!

Here's the full code I have (copied straight from the book):

import os
# The DISPTYPE can be either ‘pygame’ or ‘psychopy’
DISPTYPE = 'pygame'

# The DISPSIZE should match your monitor’s resolution!
DISPSIZE = (1920, 1080)
# Set the TRACKERTYPE to the brand you use
# DUMMYMODE should be True if no tracker is attached
# Foreground colour set to white
FGC = (255, 255, 255)
# Background colour set to black
BGC = (0, 0, 0)
# Fixation mark time (milliseconds)
FIXTIME = 2000
# Image time (milliseconds)
IMGTIME = 10000
# Get the path to the current folder
DIR = os.path.dirname(os.path.abspath(__file__))
# Get the path to the image folder
IMGDIR = os.path.join(DIR, 'images')
# Get a list of all image names
IMGNAMES = os.listdir(IMGDIR)
# Sort IMGNAMES in alphabetical order

import os
from constants import *
from pygaze.display import Display
from pygaze.screen import Screen
from pygaze.keyboard import Keyboard
from pygaze.eyetracker import EyeTracker
import pygaze.libtime as timer
# Initialise a Display to interact with the monitor
disp = Display()
# Initialise a Keyboard to collect key presses
kb = Keyboard(keylist=None, timeout=None)
# Create a Screen for the image task instructions
inscr = Screen()
inscr.draw_text(text='Please look at the images. \n\n(Press any key to begin)', fontsize=24)
# Create a Screen with a central fixation cross
fixscr = Screen()
fixscr.draw_fixation(fixtype='cross', diameter=8)
# Create a Screen to draw images on later
imgscr = Screen()
# Initialise a new EyeTracker
tracker = EyeTracker(disp)
# Calibrate the eye tracker
# Feed the instructions to the Display
# Show the instructions
# Wait until the participant presses any key
# (Allowing them to read the instructions at their own pace)
# Loop through all image names
for imgname in IMGNAMES:
    # Construct the path to the image
    imgpath = os.path.join(IMGDIR, imgname)
    # Draw the image on imgscr
    # (clear imgscr first, to be sure it’s clean)
    # Start recording gaze data
    # Display a status message on the EyeLink computer
    # (EyeLink only; doesn’t do anything for other brands)
    tracker.status_msg(‘Trial with %s image’ % (imgname))
    # Log trial start
    # Feed the fixation Screen to the Display
    # Update the monitor to show the fixation mark
    # Log the fixation onset to the gaze data file
    # Wait for the right duration
    # Feed the image Screen to the Display
    # Update the monitor to show the image
    # Log the image onset to the gaze data file
    # Include the image name in the message!
    tracker.log('image_onset, imgname=%s' % (imgname))
    # Wait for the right duration
    # Clear the Display
    # Update the monitor to show a blank screen
    # Log the image offset
    # Log the end of the trial
    # Pause recording
# Clear the instructions Screen
# Write a new message
inscr.draw_text(text='All done!', fontsize=24)
# Feed the new message to the Display
# Show the message
# Wait until the participant presses any key
# (Allowing them to read at their own pace)
# Close the connection to the eye tracker
# (This will also close the log file!)
# Close the Display


  • Hi mmshields,

    Could you post the stack trace of the error? That would give some hints where which code is executed and at which stage the problem occurs. You can also upload your full script.

    By the way, which version of Pygaze do you use?



    Buy Me A Coffee

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 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