Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DanielMiklody
Copy link
Contributor

added functions for labstreaming layer (lsl) online toolbox support for feedback

end
case 'lsl',
if ~isempty(control_signal),
data_feedback.opt.outlet.push_sample(control_signal{2}(1));
Copy link
Contributor

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?

Copy link
Contributor Author

@DanielMiklody DanielMiklody May 30, 2017

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...

Copy link
Contributor

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.

Copy link
Contributor Author

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();
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@BenjaminBlankertz BenjaminBlankertz left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants