OpenViBE forum

The OpenViBE community
It is currently Tue Jul 16, 2019 10:31 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jun 27, 2019 3:21 pm 
Offline

Joined: Fri Feb 22, 2019 3:27 pm
Posts: 15
Hi,

I am trying to create a box with an integer as an output, I want to send a score to a Matlab box. However since the only output compatible is a stimulation I don't know how the conversion is done.
I am sending the git link of the .h and the .cpp
https://github.com/TristanVenot/Score.git

Thank you in advance,

Tristan


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 01, 2019 8:49 am 
Offline

Joined: Wed Oct 31, 2018 9:14 am
Posts: 91
466/5000
I looked at your code diagonally, You want to send any int by stimulation. I have never tested sending anything, but normally the stimulations are codified (http://openvibe.inria.fr/stimulation-codes/). Between 0 and 31 you have the OVTK_StimulationId_Number_XX. You can put a stimulation listener after your box to see if he agrees by sending a little bit of everything.
On the other hand, the encode header is necessary to do it only once
Code:
m_oOutput0Encoder.encodeHeader();

There is also the possibility to send a (1,1) matrix


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 02, 2019 9:36 am 
Offline

Joined: Fri Feb 22, 2019 3:27 pm
Posts: 15
Hi,

Thank you for your answer, sending int with the stimulation is possible, the identifier will just send the number, I think the limit is uint32, after this my memory was overloaded when I tried to send a stimulation this big. However, you cannot send directly negative int (it will give you a gigantic number instead of for example -1). My data were between -10 and 10 so I came up with a simple solution, you do the absolute value of your data and if it is negative you multiply them by a 100, at the reception you just reconfigure by saying if it is superior to 100, you divide them by 100 and put a negative sign. if you check on the gitHub the new version it works fine now.

Best,
Tristan V.


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 0 guests


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:  
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.