OpenViBE forum

The OpenViBE community
It is currently Fri Dec 15, 2017 9:28 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Jan 16, 2014 4:47 pm 
Offline

Joined: Tue Nov 26, 2013 3:43 pm
Posts: 22
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:
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:
File comment: My scenario
printscreen.png
printscreen.png [ 33.32 KiB | Viewed 2226 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 17, 2014 9:07 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 601
Location: INRIA Rennes, FRANCE
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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jan 17, 2014 10:06 am 
Offline

Joined: Tue Nov 26, 2013 3:43 pm
Posts: 22
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:
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:
Analog Channel : 0 / Analog Value : -1.22847


Well, thanks for help (magic) :)


Top
 Profile  
Reply with quote  
PostPosted: Sat Jan 18, 2014 3:11 pm 
Offline

Joined: Tue Nov 26, 2013 3:43 pm
Posts: 22
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:
 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 127 times
printscreen.png
printscreen.png [ 38.42 KiB | Viewed 2209 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2014 9:15 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 601
Location: INRIA Rennes, FRANCE
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 20, 2014 3:59 pm 
Offline

Joined: Tue Nov 26, 2013 3:43 pm
Posts: 22
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.