Developing new task based on Mu Rythm

Forum for software developers to discuss BCI2000 software development
Locked
razor87
Posts: 5
Joined: 26 Apr 2014, 04:47

Developing new task based on Mu Rythm

Post by razor87 » 09 May 2014, 12:20

Good Afternoon,
I'm new to BCI world and so I'm sorry for my possibly silly questions.
Our lab has recently aquired the gtech usbamp amplifier and I'm tring to develop an application to control a remote robot, probably NAO) using Brain signals.

I already overtaken the basic tutorial like cursor task and the feedback task and I believe to have the basic knowledge to understand how BCI2000 work.

I would realize an application in which I show 8 target on the screen, controlled by 2D Mu rythm (left hand, right hand, both feet, imagined cube rotation) corresponding to 8 direction and send the state corresponding to the hit to the robot to control its movements.

I have some question:
1) I already found the appConnector module with send states over udp protocol, I wonder how to change it to TCP/IP (this is a requirement of the project)?

2) How could I start to adapt the code from mu Rythm task to my application?

thank you

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Developing new task based on Mu Rythm

Post by boulay » 11 May 2014, 21:19

razor87 wrote:Good Afternoon,
1) I already found the appConnector module with send states over udp protocol, I wonder how to change it to TCP/IP (this is a requirement of the project)?
In your BCI2000 src\shared\modules\application directory you'll notice the code for the app connector there. "ConnectorFilters.h" includes "SockStream.h". SockStream is what holds the UDP code, but it also has TCP code.

I'm not sure exactly how to do it, but I think you could create a new appConnectorTCP by copying all the code for appConnector and making the necessary changes to TCP. I'm sure you could find some examples within the BCI2000 source code on how to use SockStream's client_tcpsocket class.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Developing new task based on Mu Rythm

Post by boulay » 11 May 2014, 21:24

razor87 wrote:Good Afternoon,
2) How could I start to adapt the code from mu Rythm task to my application?
I guess that, since you intend to use appConnector, you'll have some interface that reads the state and translates that to robot commands. Is that true? If so, then I think you can play with CursorTask parameters to get your 8 targets and transmit the states (sorry I don't know which states off-hand) that indicate which target was hit, and you'll interface will handle it from there.

If your interface is pretty limited, and you have to transmit specific TCP commands, then I recommend not using appConnector and instead creating your own Application module (based on CursorTask) that transmits the TCP commands directly.

I know I have not given you enough information to do all this but after you spend a little more time with the code and tell me how you hope to implement your solution then I'll be able to give you more specific directions.

Good luck,
Chad

razor87
Posts: 5
Joined: 26 Apr 2014, 04:47

Re: Developing new task based on Mu Rythm

Post by razor87 » 13 May 2014, 04:45

Thank you for your answer. another question, I connected my application with the udp version of AppConnector and I could see a lot of state, how can I filter theese states because I'm interested in getting just ResultCode State (correspondig to the block id hit by the cursor) to send it to the robot.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: Developing new task based on Mu Rythm

Post by boulay » 13 May 2014, 19:56

As far as I can tell, AppConnector does not allow you to specify which states to send; it sends all of them and the control signal. It's up to your application to choose the information you need. There are an infinite number of ways you can do that. It depends mostly on the architecture of your application, the programming language, which libraries you are using for networking, etc. Can you explain your application in a little more detail?

razor87
Posts: 5
Joined: 26 Apr 2014, 04:47

Re: Developing new task based on Mu Rythm

Post by razor87 » 28 May 2014, 08:27

Hi, I reached in getting my TCP socket modifing the simpleConnector.cpp including a TCP socket instead the UDP ones and not it's working.
I would now try to use the appConnector to have a nice GUI but I've found a strange behaviour.
Connecting the appConnector and starting my task I see the initial values of the states but the're not updated even if the client is connected. Someone found the same problem?
Like is shown in the snippet i see all states trasmitted but they're not updated over the time and remain always the same.
I already tried so many version downloaded from the svn to check out if the're some problem with the source but no one work. Does someone has a working appconnector source code that I could try?
Thank you
Attachments
appconnector.PNG

Locked

Who is online

Users browsing this forum: No registered users and 0 guests