diff options
author | Théo de la Hogue | 2022-04-06 15:19:39 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-04-06 15:19:39 +0200 |
commit | 4b5ef94e4c0afa7ac02b3acdb2a6229389e084ed (patch) | |
tree | 1d09788f908b39a130129fb40215019139d42eea /src | |
parent | 819b9e634b18b9aaebb3cc92291927e33dd99589 (diff) | |
download | argaze-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.py | 5 |
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) |