Code Monkey home page Code Monkey logo

unicorn-bci-sync's Introduction

Author: Felix A. Maldonado Osorio

Affiliation: Drexel University, PHL, PA

Background

This project is intended for data synchronization between OpenVibe BCI platform and Tobii eyetracker system via Arduino system.

This project is being conducted at Drexel University's Cognitive Neuroengineering and Quantitative Experimental Research (CONQUER) Collaborative Laboratory under the supervision of Dr. Hasan Ayaz.

requirements.txt

To install requirements, run the following in your environment:

pip install -r requirements.txt

main.py

Recieves keyboard stimulus from OpenVibe software via TCP and forwards trigger to Tobii eye-tracker system. This code waits for keyboard input and saves external stimulus' information on count,elapsed_time, and '''delay_time'''. Timestamps can also be saved on OpenVibe directly if needed.

  • TCP_IP = '' : Server IP address. Default to localhost = 127.0.0.1.
  • TCP_PORT = 5678: Default TCP Writer Box port. Can be changed within OpenVibe.

How to run: (Has not been updated for app implementation)

  • You can check host port on Windows by: Settings>Network & internet > Wi-Fi > "your_network" and locate IPv4 address: x:x:x:x
  • To check if connected, run ping -c 1 host_port on RaspberryPi.
    1. Tip: Use VNC Viewer or SSH to remotely connect and run scripts on RaspberryPi, removing need for monitor and peripherals.
  • Change TCP_PORT = "127.0.0.1" and TCP_PORT = 5678 to necessary values.
  • Run main.py.
  • Send stimulus by pressing any stim label key (e.g. 'a') on host computer, RaspberryPi is listening and forwards to Tobii. Stim labels can be found at 'stim_labels.png'
  • To close:
    1. Click CTRL+C on command window. main.py will saves each timestamp instantly.

keyboardstim.xlm

OpenVibe scenario. Press any assigned key to send stmiulus to Tobii eye-tracker. List can be found in resources/Stim_labels.png.

testcodes/

  • test_blink.py Simple LED blink program on RaspberryPi. Helpful to test circuit connection to output.
  • test_stim_button.py Sends stimulus to OpenVibe when pressing button.
  • test_tcp.py Connects to OpenVibe port and sends periodic stimulus to host.
  • ping.py (Unstable on RaspberrryPi). Sends ping to host computer. Run before main.py to ensure connectivity.

data/

Stores test data into .csv format with columns count, elapsed_time, delay_time with date when main.py is ran.

Next steps:

(In no specific order)

  • add functionality to run upon startup (this is done on individual RaspberryPi's) this removes the need to need RaspberryPi peripherals to run code.
  • implement latency measurements
  • update delay_time algorithm bug (calculates time from previous sent stimulus)
  • create a class module

Known Issues

  1. RuntimeError: No access to /dev/mem. Try running as root! (Ubuntu 18.04) This is a permissions issue, try running the following as sudo:
cd /dev
sudo chmod og+rwx gpio*

Now, run /unicorn-bci-cync/testcodes/test_blink.py and you should not get the error again.

unicorn-bci-sync's People

Contributors

felixmaldonadoos avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.