-
Notifications
You must be signed in to change notification settings - Fork 29
4. Examples
Davide De Tommaso edited this page Jun 21, 2019
·
7 revisions
A set of Python examples are provided to start exploiting the device.
Once the TobiiGlassesPyController is correctly installed, please download the examples from the repository:
git clone https://github.com/ddetommaso/TobiiGlassesPyController-examples.git
cd TobiiGlassesPyController-examples
A simple Python script showing how to connect with the device
cd TobiiGlassesPyController-examples
python connect.py
[DEBUG]: Connecting to the Tobii Pro Glasses 2 ...
[DEBUG]: Tobii Pro Glasses 2 successful connected!
A Python script showing how to stream data
[DEBUG]: Connecting to the Tobii Pro Glasses 2 ...
[DEBUG]: Tobii Pro Glasses 2 successful connected!
{u'status': u'Discharging', u'remaining_time': 2220, u'level': 37}
[DEBUG]: Start streaming ...
[DEBUG]: Data streaming started...
[DEBUG]: Data streaming successful started!
Please wait ...
Head unit: {'ac': {u's': 0, u'ts': 108539366, u'ac': [-0.196, -9.618, 3.044]}, 'gy': {u's': 0, u'ts': 108548579, u'gy': [1.05, -2.855, 1.274]}}
Left Eye: {'pc': {u'pc': [30.94, -29.18, -30.83], u's': 0, u'gidx': 144, u'ts': 108490331, u'eye': u'left'}, 'gd': {u'eye': u'left', u's': 0, u'gd': [0.0515, 0.4245, 0.9039], u'gidx': 144, u'ts': 108490331}, 'pd': {u'eye': u'left', u's': 0, u'gidx': 144, u'ts': 108490331, u'pd': 4.07}}
Right Eye: {'pc': {u'pc': [-32.75, -28.28, -30.27], u's': 0, u'gidx': 144, u'ts': 108490331, u'eye': u'right'}, 'gd': {u'eye': u'right', u's': 0, u'gd': [-0.005, 0.4736, 0.8807], u'gidx': 144, u'ts': 108490331}, 'pd': {u'eye': u'right', u's': 0, u'gidx': 144, u'ts': 108490331, u'pd': 4.02}}
Gaze Position: {u's': 0, u'gp': [0.4842, 0.0012], u'gidx': 125, u'ts': 108300574, u'l': 75316}
Gaze Position 3D: {u's': 0, u'gidx': 125, u'ts': 108300574, u'gp3': [65.62, 1233.63, 2488.21]}
Head unit: {'ac': {u's': 0, u'ts': 108539366, u'ac': [-0.196, -9.618, 3.044]}, 'gy': {u's': 0, u'ts': 108548579, u'gy': [1.05, -2.855, 1.274]}}
Left Eye: {'pc': {u'pc': [30.94, -29.18, -30.83], u's': 0, u'gidx': 144, u'ts': 108490331, u'eye': u'left'}, 'gd': {u'eye': u'left', u's': 0, u'gd': [0.0515, 0.4245, 0.9039], u'gidx': 144, u'ts': 108490331}, 'pd': {u'eye': u'left', u's': 0, u'gidx': 144, u'ts': 108490331, u'pd': 4.07}}
Right Eye: {'pc': {u'pc': [-32.75, -28.28, -30.27], u's': 0, u'gidx': 144, u'ts': 108490331, u'eye': u'right'}, 'gd': {u'eye': u'right', u's': 0, u'gd': [-0.005, 0.4736, 0.8807], u'gidx': 144, u'ts': 108490331}, 'pd': {u'eye': u'right', u's': 0, u'gidx': 144, u'ts': 108490331, u'pd': 4.02}}
...
A Python script showing how to calibrate the device and record an eye-tracking session in the SD card.
A Python script that visualise the live view of the scene camera using OpenCV.
A Python script showing the live view of the scene camera mapped with the actual gaze.
An example of Opensesame experiment using Tobii Pro Glasses 2