aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2022-04-06 15:19:39 +0200
committerThéo de la Hogue2022-04-06 15:19:39 +0200
commit4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed (patch)
tree1d09788f908b39a130129fb40215019139d42eea /src
parent819b9e634b18b9aaebb3cc92291927e33dd99589 (diff)
downloadargaze-4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed.zip
argaze-4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed.tar.gz
argaze-4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed.tar.bz2
argaze-4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed.tar.xz
Offsetting data stream timestamp
Diffstat (limited to 'src')
-rw-r--r--src/argaze/TobiiGlassesPro2/TobiiData.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiData.py b/src/argaze/TobiiGlassesPro2/TobiiData.py
index 42042ef..172aa12 100644
--- a/src/argaze/TobiiGlassesPro2/TobiiData.py
+++ b/src/argaze/TobiiGlassesPro2/TobiiData.py
@@ -78,6 +78,7 @@ class TobiiDataStream(threading.Thread):
self.__data_socket = self.__network.make_socket()
self.__data_queue = queue.Queue()
+ self.__ts_start = 0
self.__stop_event = threading.Event()
self.__read_lock = threading.Lock()
@@ -156,8 +157,6 @@ class TobiiDataStream(threading.Thread):
# convert timestamp
ts = json_data.pop('ts')
- #print(f'json_data at {ts}: {json_data}')
- '''
# keep first timestamp to offset all timestamps
if self.__ts_start == 0:
self.__ts_start = ts
@@ -167,7 +166,7 @@ class TobiiDataStream(threading.Thread):
# ignore negative timestamp
if ts < 0:
break
- '''
+
# convert json data into data object
data_object_type = '_'.join(json_data.keys())
data_object = DataStructures.DictObject(data_object_type, **json_data)