Connecting OpenViBE to Arduino.openvibe.inria.fr/openvibe/wp-content/uploads/2016/... · Connecting...
Transcript of Connecting OpenViBE to Arduino.openvibe.inria.fr/openvibe/wp-content/uploads/2016/... · Connecting...
Connecting OpenViBE to Arduino.
- Camille Jeunet -- PhD in Cognitive Sciences, Univ. Bordeaux / Inria -
May, 30th - 2016
- OpenViBE Workshop, BCI Meeting -
2
- 0.0 - Bad News -
3
- 0.1 - Good News x 3 -
- I - Context -
4
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
- I - Context -
5
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
?What
- I - Context -
6
- I - Context -
7
“Ride a bike”
“Good”
“Bad”
“Stop”
- I - Context -
8
Around 17% of the users did not manage to learn.
- I - Context -
9
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
?What
- I - Context -
10
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
Feedback?What
- I - Context -
11
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
Feedback?What
?How
- I - Context -
12
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
Feedback
Tactile Feedback [Control-Display Mapping]
?What
?How
- I - Context -
13
XP #1 - Vibrotactile feedback in a multitasking context.
- I - Context -
15
XP #1 - Vibrotactile feedback in a multitasking context.
- I - Context -
16
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
Feedback
Tactile Feedback [Control-Display Mapping]
?What
?How
- I - Context -
17
Feedback
Tactile Feedback [Control-Display Mapping]
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
?What
?How
?Why
- I - Context -
18
Feedback
Tactile Feedback [Control-Display Mapping]
Improves the
Sense of Agency?
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
?What
?How
?Why
- I - Context -
19
XP #2 - Impact of the Sense of Agency on MI-BCI Performance
- I - Context -
20
Feedback
Tactile Feedback [Control-Display Mapping]
Improves the
Sense of Agency ?
What is the impact of
the training protocol?
What is the impact of
the user’s profile?
?What
?How
?Why
- II - Connecting OpenViBE to Arduino -
21
OPENVIBE ARDUINOPYTHON SCRIPT
MOTORS
- II - Connecting OpenViBE to Arduino -
22
OPENVIBE ARDUINOPYTHON
SCRIPTING
MOTORS
- II - Connecting OpenViBE to Arduino -
23
OPENVIBE
openvibe > share > openvibe > scenarios > bci-examples > motor-imagery-CSP
Acquisition
CSP filters
Time based epoching
Power
Normalisation
Classifier
Graz Visu Lua Stimulatorshow feedback
- II - Connecting OpenViBE to Arduino -
24
Acquisition
CSP filters
Time based epoching
Power
Normalisation
Classifier
Graz Visu Lua Stimulator
OPENVIBE
LSL Export Stimulation Filter
Stream[0] = classif outputStream[1] = stimulations
NO show feedback
- II - Connecting OpenViBE to Arduino -
25
OPENVIBE ARDUINO
MOTORS
PYTHON SCRIPT
- II - Connecting OpenViBE to Arduino -
26
1. Import some packages – Add pylsl to known pathimport sys; sys.path.append('./pylsl') from pylsl import StreamInlet, resolve_streamimport serialimport time
2. Open a serial port (windows)serialPort = serial.Serial('COM14', 9600, timeout=1)
3. Connection to Arduino
4. Communication with OpenViBE4.1 Resolve an EEG stream
streams = resolve_stream('type', 'EEG')4.2 Create a new inlet to read from the stream
inlet = StreamInlet(streams[0])
PYTHON SCRIPT
- II - Connecting OpenViBE to Arduino -
27
PYTHON SCRIPT
5. Action!while Connected2Arduino:
get sample (classif_output + stimulation)if stimulation == left
instruction = leftelif stimulation == right
instruction = right
if stimulation == feedback_continuousmotor2activate = f(classif_output, instruction)serialPort.write('motor2activate')
elif stimulation == endOfTrialserialPort.write(‘stopMotors')
- II - Connecting OpenViBE to Arduino -
28
PYTHON SCRIPTING
5. Action!while Connected2Arduino:
get sample (classif_output + stimulation)if stimulation == left
instruction = leftelif stimulation == right
instruction = right
if stimulation == feedback_continuousmotor = f(classif_output, instruction)serialPort.write('motor2activate')
elif stimulation == endOfTrialserialPort.write(‘stopMotors')
- II - Connecting OpenViBE to Arduino -
29
PYTHON SCRIPT
5. Action!while Connected2Arduino:
get sample (classif_output + stimulation)if stimulation == left
instruction = leftelif stimulation == right
instruction = right
if stimulation == feedback_continuousmotor2activate = f(classif_output, instruction)serialPort.write('motor2activate')
elif stimulation == endOfTrialserialPort.write(‘stopMotors')
- II - Connecting OpenViBE to Arduino -
30
OPENVIBE
MOTORS
PYTHON SCRIPTING
ARDUINO
- II - Connecting OpenViBE to Arduino -
31
ARDUINOArduino script
get the sample from the serial portif sample == motor2activate
activate motor2activateelif sample == stopMotors
stop the motors
- II - Connecting OpenViBE to Arduino -
32
OPENVIBEPYTHON
SCRIPTING
MOTORS
ARDUINO
- II - Connecting OpenViBE to Arduino -
33
MOTORS
- Thank You! -
34
- Camille Jeunet -
- camillejeunet.wordpress.com -
- https://team.inria.fr/potioc/ -
- https://twitter.com/potioc_team -
- Camille Jeunet -
- camillejeunet.wordpress.com -
- https://team.inria.fr/potioc/ -
- https://twitter.com/potioc_team -
35
- Thank You! -