OpenBCI and LSL4Unity
I am currently working with the Ultracortex Mark 4 with the Cyton Daisy
Board. My goal is to build an application around the principle of Motor
Imagery to be able to control objects in Unity. I was able to find out from
the documentation that LSL can be used for this purpose. Unfortunately I
have problems to get LSL4Unity to work with the OpenBCI.
I tried to use LSL with Python first and used the instructions at this link:
"https://docs.openbci.com/Software/CompatibleThirdPartySoftware/LSL/"
Now I have the problem that some packages in the script do not work and I get a
lot of error messages. I get the following errors according to the current status:
Traceback (most recent call last):
File "C:/Users/fkolb/Desktop/LSL_Connection/venv/openbci_lsl.py", line
56, in <module>
main(sys.argv[1:])
File "C:/Users/fkolb/Desktop/LSL_Connection/venv/openbci_lsl.py", line
31, in main
import lib.gui as gui
File "C:\Users/fkolb/Desktop/LSL_Connection/venv/openbci_lsl.py", line
16, in <module>.
import pyqtgraph as pg
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\__init__.py",
line 186, in <module>
from .graphicsItems.VTickGroup import *
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\graphicsItems\VTickGroup.py",
line 9, in <module>
from .UIGraphicsItem import UIGraphicsItem
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\graphicsItems\UIGraphicsItem.py",
line 3, in <module>
from .GraphicsObject import GraphicsObject
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\graphicsItems\GraphicsObject.py",
line 4, in <module>
from .GraphicsItem import GraphicsItem
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py",
line 2, in <module>
from ..GraphicsScene import GraphicsScene
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\GraphicsScene\__init__.py",
line 1, in <module>
from .GraphicsScene import *
File
"C:\Users\fkolb\Desktop\LSL_Connection\venv\lib\site-packages\pyqtgraph\GraphicsScene\GraphicsScene.py",
line 22, in <module>
class GraphicsScene(QtGui.QGraphicsScene):
AttributeError: module 'PyQt5.QtGui' has no attribute 'QGraphicsScene'.
Is there any further support or solutions for this in any way?
Unfortunately, I have to admit that I have very little experience with
programming in general, so surely one or the other error may have been
caused by my lack of knowledge. Nevertheless, I would be very happy about
feedback, because I am very interested in working with BCI and I want to
write my master thesis about it.
Kind regards,
Florian
Comments
Florian, hi.
It appears you are using the
OpenBCI_LSLpackage. Which was deprecated (discontinued) long ago. Many bugs.https://github.com/openbci-archive/OpenBCI_LSL
We recommend that you use the OpenBCI GUI Networking Widget (LSL) to stream out your LSL.
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#lsl
Alternately, there is a Python binding for the Brainflow library, it can read from Cyton the data stream. And then you can SEND that data stream, using the official LSL library.
https://brainflow.readthedocs.io/en/stable/Examples.html#python
https://github.com/labstreaminglayer/pylsl
William
Richard, @retiutut, hi.
It seems that the current LSL section in docs is pointing to an old deprecated / buggy package. Instead it should mention the options I listed in the previous comment (Networking Widget, or DIY Brainflow + pylsl). Regards, William
https://docs.openbci.com/Software/CompatibleThirdPartySoftware/LSL/
https://github.com/openbci-archive/OpenBCI_LSL ['-archive' implies deprecated, buggy]
Hi William,
thanks a lot for your response and the clarification.
Can you tell me if there is any difference if i stream playback oder live data via lsl? For testing it would be easier to send data i already recorded but I just wanted to make sure it doesn't affect the outcome in any way.
Kind regards,
Florian
Richard @retiutut may comment. I believe the widgets such as Networking Widget, see the same data stream on both live and playback. Otherwise the widgets showing time series and FFT, etc. would not be displaying correctly on the screen.
Try GUI 5.2.1 and UDP or LSL. We've done a major refactor of the Networking Widget.
This refactor is heavily inspired by our work on the NeuroFly Project: https://www.ted.com/talks/conor_russomanno_a_powerful_new_neurotech_tool_for_augmenting_your_mind?language=en