PhilippThoelke / goofi-pipe

real-time neuro-/biosignal processing and streaming pipeline
MIT License
22 stars 2 forks source link

Integrating pyautogui for versatile biofeedback control interfaces #6

Open GeorgeFejer91 opened 10 months ago

GeorgeFejer91 commented 10 months ago

Hi all, Another project I am working on is the creation of bioresponsive gameinterfaces, where I use the R-R intervals of heartbeats as a game controller. With the help of pyautogui (https://github.com/asweigart/pyautogui), whenever the heartbeat reaches a certain threshold, it initiates a keyboard event such as a button press. I find this solution quite practical, as it allows seamless integration with any type of PC game that is running in the background. The main issue I have is the latency, as there is often a 500 ms latency already, due to the streaming lag of my ECG device (Polar H10). But with the help of goofi-pipe, it may be possible to predict the occurrence of the next R interval and overcome this latency.

So my question (or request) is how difficult it would be to add a pyautogui module, which can initiate some keyboard event (Y) whenever some threshold value (X) is reached?

PhilippThoelke commented 10 months ago

This shouldn't be very complicated to add. It might be useful to implement this in two different modes:

  1. button press when the threshold on an input signal is surpassed
  2. button press whenever a previous node sends some data to the pyautogui node

Feel free to open a pull request if you want to have a go at this.