This is Jaime from the University of Fribourg (Michael Schmid group).
I have a question regarding the integration of devices with MWorks.
We are interested in interfacing a Pupil Labs eye tracker with MWorks, as well as some sensors that are compatible with the Lab Streaming Layer (LSL) protocol (https://labstreaminglayer.org).
Could you please let us know if it is possible to interface these devices with MWorks through the LSL protocol, or if there is another way to integrate the Pupil Labs eye tracker?
Thanks for the pointer to LSL. I was not aware of it until now.
Regarding Pupil Labs’ eye trackers specifically: The devices support a network API based on ZeroMQ and MessagePack. Pupil Labs provides a Python library to perform the network communication, so the fastest way to get started would probably be to use that via MWorks’ Python actions.
Another option would be to implement a custom MWorks plugin for communicating with Pupil Labs trackers. MWorks already uses both ZeroMQ and MessagePack for communication between client and server, so it would just be a matter of implementing the actual messaging and MWorks interface.
As for supporting LSL-compliant devices in general: The core LSL libary is written in C++, so it would integrate very naturally with an MWorks plugin. There is also a Python interface to the core library, so, again, MWorks’ Python actions would be an option.
One potential issue with LSL is that, as far as I can tell, it supports data streaming but not device control and configuration. That might not be an issue for simple devices with little to no configuration. However, for something like the Pupil Labs Core, MWorks would, at a minimum, need to be able to start and stop recordings. Since LSL doesn’t support that, MWorks would have to use another interface (i.e. the network API mentioned above) to handle it. (If you haven’t already, I’d recommend looking at Pupil Labs’ compatible tools page and comparing the functionality provided by the Python and LSL interfaces.)
Do you have in mind some specific, LSL-compatible sensors that you’d like to use with MWorks? If you tell me what they are, I can take a look at their interfaces and see if LSL would be sufficient for connecting them to MWorks.
We are looking to connect two devices to MWorks:
• Starstim 8 (https://www.neuroelectrics.com/starstim-8)
• EmotiBit (https://www.emotibit.com/product/emotibit/)
Both devices only require reading their data streams
I’ve seen that LSL is widely used for synchronizing different sensors, but I was wondering if there are significant timing issues.
As for using python actions for reading /config the pupil labs eye tracker: how can this be done?
It looks like you need to use NIC2 to control the Starstim 8, but you can get the data in to MWorks via LSL or TCP. The EmotiBit supposedly supports LSL out of the box, and it’s also compatible with the BrainFlow SDK, which would be another way for MWorks to interface with it.
It seems like it might be possible to implement a general-purpose LSL interface plugin for MWorks. Let me investigate and think about how that could work.
As for using python actions for reading /config the pupil labs eye tracker: how can this be done?
I can work up an example for you. FYI, I’m going to be away on vacation next week, so I probably won’t get to this until the following week (Feb. 24-28).
I’ve attached an example that demonstrates how to start, stop, and read data from a Pupil Labs eye tracker via Python. The Python code uses the Pupil Core Network API to communicate with the device. Since I don’t have access to the hardware (and Pupil Capture doesn’t seem to have a simulation mode), I haven’t been able to test the code, so there are probably bugs. If you have problems running it, let me know, and we’ll figure out how to fix it.
I also investigated developing a general-purpose LSL interface plugin for MWorks, and it seems like it wouldn’t be too hard to do. If this is something you’d like me to pursue, please let me know.
Hello, hope you had a good vacation time.
Thank you very much for the script!
And regarding the LSL interface plugin, yes, we are very much interested into this one
Thanks in advance
Cheers,