Howdy, Stranger!

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

Supported by

[open] Re-calibrate Eye Tribe

edited November 2015 in PyGaze

Hi,

I am running an experiment using the Eye-Tribe.

As the eye-tracker is portable and new, and as my experiment is quite long (72 trials), I want to insert a few breaks and re-calibrate the tracker. I am now drift-correcting before every trial, but I would like to repeat a full calibration.

I created a conditional break half-way through and inserted another Pygaze_init. I get the error message
"You should have only one instance of pygaze_init in your experiment"

I can understand that Pygaze_init is not only calibrating, but also initializing the tracker, so it shouldn't appear twice. But I need to insert a new calibration.

How can I get this done?
Unfortunately, I am not a programmer and I am using OpenSesame from the GUI interface.

Any help would be hugely appreciated
Thanks

h.

Comments

  • edited 8:18AM

    Hi Harold,

    You can simply insert an inline_script with:

    eyetracker.calibrate()
    

    As described here:

    (In 2.9 or earlier, you need to call exp.pygaze_eyetracker.calibrate().)

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited November 2015

    Thank you Sebastiaan!!

    *** edit (I always think there is more into coding than there really is)

    it works fabulously, thanks.

    h.

  • edited November 2015

    :)

  • edited 8:18AM

    Unfortunately, it seems I still have a problem.
    I introduced two breaks and two re-calibration in my script.
    The second re-calibration makes the experiment end prematurely.
    I do not get an error message, but the message 'the experiment is finished'. One third of the trials, though, did not run.

    Any suggestions?

    Thank you

    harold

  • edited November 2015

    I created a different pilot experiment to see what the problem could be with the recalibration killing it.
    This simpler one runs ok 2/3 of the times, but occasionally gives me a Runtime Error:

    Microsoft Visual C++ Runtime Library
    Program... opensesame.exe
    This application has requested the Runtime to terminate it in an unusual way.

    I have seen some other users are having problems with Runtime errors
    http://www.cogsci.nl/forum/index.php?p=/discussion/1675/open-runtime-error-while-adjusting-script-of-form-plug-in#Item_8
    but that description doesn't apply to my case.

    Thank you

  • edited November 2015

    I took a look at the debug window, and I found a message after the premature end:

    *Exception AttributeError: " ' LaminaPanelSurface' object has no attribute '_txtr' in bound method _LaminaPanelSurface.__del__of
    expyriment.stimuli._visual._LaminaPanelSurface object at 0x158C3C70 ignored*
    

    I don't know if this is relevant to my problem.

  • edited 8:18AM

    Hi Harold,

    It seems like something goes wrong in Expyriment, the library used by OpenSesame. I cannot really say much more about it, because I've never seen this issue myself, and these kind of 'hard' crashes are very difficult to debug.

    But, since the problem seems to be in the xpyriment backend, you could simply try a different backend. You can change this in the General properties tab. For example, does everything work smoothly if you use the legacy backend?

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited 8:18AM

    Hi Sebastiaan,
    Thank you for your answer.

    I worked on the script to identify the problem, and I finally fixed it.
    In my experimental sequence, I had various elements (a sentences, some pictures, and a question) and then a logger. When I added a break sketchpad and the recalibration, I had put it between these elements and the logger. By changing the place of the logger and putting it closer to those elements, everything now works fine. It seems that these elements were intervening between the response and the logger and were creating a conflict.

    Thank you for your assistance and for the development of these open source tools.

    best
    h

  • edited 8:18AM

    Hi

    I am still having some crashes if I restart the calibration. I updated to version 3. It does not all the times, but it can happen in the initialization as well as in my in-line script.
    The debug window reports the error as "calibration is already in progress", identifies it in calibration.start() and it tags it as error 403.

    Is there anything I could do about it?
    Thank you

    h

  • edited 8:18AM

    Hi,

    Could you post the full stacktrace? You can find that in the debug window.

    And is there any regularity behind the crash. For example, can you take certain steps to reliably reproduce it?

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited November 2015

    Hi Sebastiaan,

    here's the problem:

    Recalibrating sometimes leads to a crash. I updated Opensesame to version 3 and I am using Legacy. I introduced an inline script for recalibrating every 1/3 of trials, using the function eyetracker.calibrate()

    If calibration is unsuccessful and I press R to restart, it crashes and I get this message (while I don’t seem to have this problem if I restart a successful calibration)

    *Error while executing inline script
    
    item-stack: experiment[run].experiment_loop[run].recalibration_inline_script[run]
    exception type: Exception
    exception message: Error in calibration.start: Calibration already in progress (code 403)
    item: recalibration_inline_script
    time: Tue Nov 10 13:51:18 2015
    phase: run
    
    Traceback:
      File "dist\libopensesame\inline_script.py", line 96, in run
      File "dist\libopensesame\python_workspace.py", line 160, in _exec
      File "<string>", line 2, in <module>
      File "dist\pygaze\_eyetracker\libeyetribe.py", line 193, in calibrate
      File "dist\pygaze\_eyetracker\pytribe.py", line 1127, in start
    Exception: Error in calibration.start: Calibration already in progress (code 403)*
    

    Thanks for any suggestion
    h

  • edited 8:18AM

    It's not ideal, but for now this can be fixed with a monkeypatch to the pytribe.calibration class. This simply aborts any current calibration and retries, if necessary.

    import pygaze._eyetracker.pytribe
    
    def start_new(self, pointcount=9):
    
        """Starts the calibration, using the passed number of calibration
        points
    
        keyword arguments
    
        pointcount  --  integer value indicating the amount of
                        calibration points that should be used, which
                        should be at least 7 (default = 9)
        """
    
        attempts = 0
        max_attempts = 3
        while attempts < max_attempts:
            # send the request
            response = self.connection.request('calibration', 'start', {'pointcount':pointcount})
            # return value or error
            if response['statuscode'] == 200:
                return True
            self.abort()
            attempts += 1
    
        raise Exception("Error in calibration.start: %s (code %d)" % (response['values']['statusmessage'],response['statuscode']))
    
    pygaze._eyetracker.pytribe.calibration.start = start_new
    
  • edited 8:18AM

    p.s. I should have said, for this fix to work the code above should be in an inline code item right at the start of the experiment (before any use of pygaze_init).

  • edited 8:18AM

    This solution seems to work fine. I'll pilot more and update in case.

    Thanks

  • edited 8:18AM

    @alisdt That's great, thank you. Since you seem to known what you're doing, would you be interested in submitting a pull request with this fix through GitHub? If so, please submit it to the os3 branch of my fork, which currently has the most up-to-date code.

    If not, no problem, and I'll push a fix myself.

    Buy Me A Coffee

  • edited 8:18AM

    Hi @alisdt and @harold_mb,

    I added a variation of this fix to PyGaze, which is newly packaged in the 3.0.3 prerelease. Would you mind trying out the latest prerelease (not 3.0.3a3) to see if this resolves the recalibration issue?

    Cheers,
    Sebastiaan

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