OpenViBE forum

The OpenViBE community
It is currently Mon Dec 10, 2018 9:54 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jun 07, 2017 2:40 pm 
Offline

Joined: Wed Jun 07, 2017 11:57 am
Posts: 7
Hello to the community.
I have a problem, I want to get the outputs of the lua accumulator p300 (which are the stimulation of the rows and columns of the P300 array) and use them as inputs in a matlab scripting box for the process function. That is to say that the process function obtains as input the outputs of the lua accumulator P300. However I do not know how to do it. Thank you for your future answers.
The code of the stimulation outputs of the lua speller accumulator is:

box:send_stimulation(1, maxRowIdx + row_base, now, 0)

box:send_stimulation(2, maxColIdx + col_base, now, 0)

And my matlab code for the procces function is:

function box_out = robotarm_process(box_in)

row = box_in.inputs{1}.matrix_data;
col = box_in.inputs{2}.matrix_data;

But I get the following error in openvibe

Reference to non-existent field 'matrix_data'.

Help please, :mrgreen:


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2017 7:49 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 771
Location: INRIA Rennes, FRANCE
Hello Ivan,

you can take a look at tuto1_signal_filter_Process.m file bundled with openvibe. There, in the first for() loop of the function, you will see an example how to extract stimulations from the input stream.

Hope this helps,
Jussi


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 08, 2017 4:26 pm 
Offline

Joined: Wed Jun 07, 2017 11:57 am
Posts: 7
Thanks for the last answer.
Watching the tutorial tuto1_signal_filter_Process and associating it with my matlab processing function
as shown:
function box_out = robotarm_process(box_in)
for i = 1: OV_getNbPendingInputChunk(box_in,2)
[box_in, start_time, end_time, row] = OV_popInputBuffer(box_in,1);
[box_in, start_time, end_time, col] = OV_popInputBuffer(box_in,2);

if(row~=0 & col~=0)
disp(row);
disp(col);
end
end
end
I note that the values ​​obtained are always zero for row and col as shown:
- MATLAB BUFFER - INFO ----
0
0
Therefore I can not go to the next part of the code, What can I do about it?
Maybe the values ​​are of the form 0x00008101 and when printing them on the screen gives zero, if that is the case as I can get the decimal value, since the hex2dec function generates errors
Another question there will be some way to debug the program?

Thanks for your future answers


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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.