Space Invaders BCI

Making & changing box plugins and external apps
Post Reply
LéoVarnet
Posts: 9
Joined: Mon Jul 05, 2010 12:32 pm

Space Invaders BCI

Post by LéoVarnet »

Hello,

I am currently working on the implementation of a "Space Invaders BCI" in an OpenViBE box. The idea is to adapt the P300 detection method : the invaders are flashed in a random sequence of rows and columns and the recording of the EEG allows us to detect which alien the subject is concentrating on, and to destroy it.
For this application, I would like to use the OGRE rendering engine inside of my box. Does anyone know whether or not this is possible, and if so how to achieve it ? I was considering deriving the box from the ExampleApplication class of ogre, but after reading the log file I realize that the Root object of Ogre was created at the initialization of openViBE, and so that my box caused an error by trying to construct a second Root object.
If this is correct, how can I access to the Root object from my box, in order to create and
modify the 3D scene ?

Best regards and thank you in advance,
Léo

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Space Invaders BCI

Post by lbonnet »

Hi Léo and welcome on board !

The best way to do a space invader BCI should be to build your own 3D application (using Ogre3D if you want), outside of OpenViBE. This is what we did with the Tie-fighter and the Handball BCIs.

OpenViBE can communicate with your 3D application using the VRPN protocol. You can find more information about VRPN
on the official website, or on the openvibe forum here or there.

You can also look at the box documentation about Analog VRPN Server and Button VRPN Server.

Finally you definitely should look at the dedicated tutorial on the website. You will learn how to implement an external application using using Ogre3D and how to build the communication process between OpenViBe and your application.

For example, you can look at the \openvibe-applications\vr-demo\trunc\src\TieFighterBCI source code.
The tie-fighter application has a vrpn client that reads data from vrpn servers on the openvibe side, and move a spaceship according to the values received.


Regards,

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

LéoVarnet
Posts: 9
Joined: Mon Jul 05, 2010 12:32 pm

Re: Space Invaders BCI

Post by LéoVarnet »

Hi Laurent !
Yes, the VRPN protocol was my first idea, however I was envisaging developing the application as a box because I thought that it would make the use simpler : the inputs of the Space Invaders box would be the sequence of stimulation generated by a P300 Speller Stimulator, so that you just have to change the parameters of the boxes if you want to modify the duration of intensification, the interval between trials, etc... However, if this is not the way to do it or if it's too complex, I can indeed also build an application like the Tie-fighter with a config file.
Anyway, thanks for the documentation !

Léo

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Space Invaders BCI

Post by lbonnet »

Hi Léo !

We had some discussion about your project with Yann.
We though about 2 solutions :

1. Ogre application + VRPN
P300 paradigm requires an absolute synchronization. If you build a dedicated application with Ogre3D, be careful with the delay with the visual stimuli. If openvibe asks your application (using VRPN) to flash a row or a column, there will be a variable delay between the flash request and the actual flash, resulting in possibly incorrect P300 identification.

To overcome this problem, U-turn the idea... Your ogre application can send to openvibe the precise time when the visual stimulus occurred. But don't use VRPN here ! you need to send electronically the triggers. Most amplifiers can do so, using parallel port connected to it (the BrainAmp standard should be able to do so).

Then, openvibe can perform its computation on the flagged signal, and send to your application the result of the classification, aka the "invader" to destroy.

2. Developing a Box
If you do all the visualisation job in a box, synchronization is easier of course. The drawback is the limitation we give with our implementation of Ogre3d inside the Designer. You won't have any access to the Ogre Root object or anything else, but you can use the given API we provide. Check here.

You can also look at the Simple 3d viewer box available in Samples. This box shows how to use the VisualisationContext. It allows you to create object, set colors, etc. You can check the source code of this box (the "...Simple3D..." files) in openvibe-plugins/simple-visualisation/.

We won't add more Ogre3D functionalities, so if you need more complicated things I'm afraid you will have to look at solution #1 ;)

Regards

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

LéoVarnet
Posts: 9
Joined: Mon Jul 05, 2010 12:32 pm

Re: Space Invaders BCI

Post by LéoVarnet »

After checking the possibilities of the IVisualisationContext Class, I think I'm rather going to use an Ogre application as you suggested. Thanks a lot for your answers ! I'll let you know my progression...
cheers,
Léo

Post Reply