-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Online lab streaming layer support #205
base: master
Are you sure you want to change the base?
Conversation
end | ||
case 'lsl', | ||
if ~isempty(control_signal), | ||
data_feedback.opt.outlet.push_sample(control_signal{2}(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better write control_signal{:} like in the UDP case. What types of data does the push_sample function accept as input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
control_signal{:} gives a key value pair and the stream only accepts floats the way it is initialized.. You can either define strings like markers or actual values for a stream and thats all it takes then. we could think about adopting the whole architecture to have 2 streams or similar...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
control_signal is only a key value pair in the pyff convention. For the feedbacks programmed in processing, it is a cell containing a double. I think that's the better way here. It makes no sense to create a key value pair, if the key is just discarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So shall we change change the pyff ccontrol message to send the key value pair by default within sendControl and so the sendControl only getting the value (my vote) or shall we handle every feedback receiver differently?
case 'tobi_c', | ||
send_tobi_c_udp('init', bbci_feedback.host, bbci_feedback.port); | ||
case 'lsl', | ||
lib = lsl_loadlib(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since LSL is not part of the BBCI toolbox, we need to do something here. The preferred way is to include the LSL toolbox in the
bbci_import_dependencies.m
if that is not done yet.
Insert
util_loadLSL();
above and add a function like the following to the toolbox:
function util_loadLSL()
if ~exist('lsl_loadlib', 'file'),
global BTB
lslDir= fullfile(BTB.Dir, 'external/liblsl-Matlab');
if exist(lslDir, 'dir'),
addpath(genpath(lslDir));
else
error(sprintf('LSL library expected in %s.\nDownload manually or use bbci_import_dependencies(''LSL')', lslDir));
end
end
The same function should be called in bbci_acquire_lsl.m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you! I have two small requests added.
added functions for labstreaming layer (lsl) online toolbox support for feedback