Reading classifier output in external app

Post Reply
pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Reading classifier output in external app

Post by pwierzgala »

Hi,

I'm learning OpenViBE and I wanted to do a motor-imagery scenario with my own visualization. I took a "motor-imagery-bci-3-online.xml" scenario from: http://openvibe.inria.fr/motor-imagery-bci/ but instaed of "Graz visualization" at the end I've connected "Simple DSP" with "Analog VRPN Server" (print screen in the attachment).

Basing on a: http://openvibe.inria.fr/vrpn-tutorial- ... plication/ I've built my own c++ application. Everything works fine except I do not how to read data that is sent to my application. In you tutorial you have a function:

Code: Select all

void VRPN_CALLBACK vrpn_analog_callback(void* user_data, vrpn_ANALOGCB analog)
{
    for (int i = 0; i < analog.num_channel; i++)
    {
        std::cout << "Analog Channel : " << i << " / Analog Value : " << analog.channel[i] << std::endl;
    }
}
and it displays data from "Sinus oscillator". Could you tell me how can I read the data (structure) that comes to my app?
Attachments
My scenario
My scenario
printscreen.png (33.32 KiB) Viewed 6827 times

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Reading classifier output in external app

Post by jtlindgren »

Hi Pwierzgala,

does the tutorial work as expected? If so, you should be similarly able to read the raw data from analog.channel array, as in the code snippet.


Cheers,
Jussi

pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Re: Reading classifier output in external app

Post by pwierzgala »

Wow, it's amazing :) I've spent the whole evening reading documentation, source code and experimenting with my own code with no result. For all that time function "vrpn_analog_callback" was executed but not the code from the loop:

Code: Select all

std::cout << "Analog Channel : " << i << " / Analog Value : " << analog.channel[i] << std::endl;
And now I ran the app again and here's my output:

Code: Select all

Analog Channel : 0 / Analog Value : -1.22847
Well, thanks for help (magic) :)

pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Re: Reading classifier output in external app

Post by pwierzgala »

I need to resume this topic. After succeed with "acquisition client" (generic oscillator) I wanted to test it with some real signal. I have to this this scenarion before connecting with eeg device. I've replaced "acquisition client" with "csv reader" but it doesen't work. The "vrpn_analog_callback" function is not executed.

I have no errors in OpenViBE log but I get the following message from my c++ app:

Code: Select all

 VRPN Warning
 (3) from openvibe_analog_vrpn_server: No response from server for >= 3 seconds
I attach sample of my csv file a print screen of my current secenario.
Attachments
sig.csv
(244.85 KiB) Downloaded 332 times
printscreen.png
printscreen.png (38.42 KiB) Viewed 6810 times

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Reading classifier output in external app

Post by jtlindgren »

Try adding 'signal display' and/or 'EBML spy' to various points of the processing chain to see if valid data is coming out. For example, the CSV reader is very picky about its input format and may not be outputting anything.


Cheers,
Jussi

pwierzgala
Posts: 22
Joined: Tue Nov 26, 2013 3:43 pm

Re: Reading classifier output in external app

Post by pwierzgala »

Thanks for the hint! I've found that when I use "CSV file reader" nothing comes out of "time based epoching" box. Do you have any idea why? Maybe there's something wrong with my csv file format. Are there any requirements about it? I've read those boxes documentation but I haven't found anything helpful there.

Post Reply