Skip to content

Simple python wrapper for communicating with pupil and external programmes that do not support zeromq.

License

Notifications You must be signed in to change notification settings

mtaung/pupil_middleman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pupil Middleman Server with MATLAB support

Deprecation Notice

This repository was built for an older version of pupil which is no longer supported. An updated version of this software is available at this repo, but that is also no longer maintained. It's likely that the tool you want will be on the pupil-helpers repository.

Contents

  • Simple python wrapper function for communicating with pupil_capture and external stimulus presentation programs that do not support zeromq, such as MATLAB.
  • Examples for pupil_capture control using MATLAB and PTB3
  • Potentially useful MATLAB support functions.

This repository also contains examples for pupil_capture control using MATLAB and Psychtoolbox 3, as and some other (potentially) useful MATLAB support scripts.

What does it do?

Provides a simple solution to allow programs such as MATLAB to communicate with pupil_capture. Enables external programs to connect via udp listening socket and converts bytes received from the socket into "annotations" (pupil-labs's name for events/triggers) to be sent to pupil_capture. Generates basic logs for debugging purposes.

Some warnings

This is a barebones middleman server that is fit for our use cases, not necessarily optimal for yours. Further, the implementtion here is outdated beyond pupil services 1.8-26, and it won't work with the newer rollouts. We will update this in the future when we have to deploy these hardware in our labs again. Pupil also provide native matlab support now, so if you're only needing that, you no longer require this tool.

UDP sockets can be unreliable (https://www.wikiwand.com/en/Reliability_(computer_networking)), although pilot testing to date suggests that it is possible to create a stable and consistent connection). Finally, there is no real implementation of time and jitter compensation/calibration. There is a Time-Sync module by Pupil Labs for this, which I will implement in the future.

Getting Started

You may need to modify the IP addresses/ports in 'sample_mm.py' Simply run 'sample_mm.py' in terminal to start the middleman server.

Running the middleman

The middleman will run up to a certain point, based on whether you have pupil-recorder on or not. You may also want to ping the middleman with some integers. For this, there is a sample trigger dictionary. I may conver this to an if tree later if mixed-cases become a thing.

Acknowledgments

  • mtaung wrote the python scripts, tombullock wrote the MATLAB scripts.
  • This code draws heavily from Pupil Labs' pupil-helpers repository.

About

Simple python wrapper for communicating with pupil and external programmes that do not support zeromq.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published