aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2024-07-23 12:36:10 +0200
committerThéo de la Hogue2024-07-23 12:36:10 +0200
commitbaf49b9adbac8060a9120b230e1e4aa85dc609bc (patch)
tree3c1a56053b0f59b2a30fe999452362e8fff4b983 /src
parente48fd3077858171301f5a81b4881f8d6b489c85d (diff)
parent9ac9b1acef0acdd82f17b400c3d41faffe0ac422 (diff)
downloadargaze-baf49b9adbac8060a9120b230e1e4aa85dc609bc.zip
argaze-baf49b9adbac8060a9120b230e1e4aa85dc609bc.tar.gz
argaze-baf49b9adbac8060a9120b230e1e4aa85dc609bc.tar.bz2
argaze-baf49b9adbac8060a9120b230e1e4aa85dc609bc.tar.xz
Merge branch 'main' of ssh://git.recherche.enac.fr/interne-ihm-aero/eye-tracking/argaze
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/contexts/TobiiProGlasses2.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/argaze/utils/contexts/TobiiProGlasses2.py b/src/argaze/utils/contexts/TobiiProGlasses2.py
index b8810ae..75cd0ff 100644
--- a/src/argaze/utils/contexts/TobiiProGlasses2.py
+++ b/src/argaze/utils/contexts/TobiiProGlasses2.py
@@ -629,7 +629,6 @@ class LiveStream(ArFeatures.DataCaptureContext):
threading.Thread.join(self.__video_thread)
-
def __make_socket(self):
"""Create a socket to enable network communication."""
@@ -742,15 +741,15 @@ class LiveStream(ArFeatures.DataCaptureContext):
# Check image validity
if image is None:
- # Wait for half frame time
- time.sleep(0.5 / self.__video_fps)
+ # Wait 1ms
+ time.sleep(1e-3)
continue
# Check image time validity
if image.time is None:
- # Wait for half frame time
- time.sleep(0.5 / self.__video_fps)
+ # Wait 1ms
+ time.sleep(1e-3)
continue
# Store first timestamp
@@ -786,10 +785,6 @@ class LiveStream(ArFeatures.DataCaptureContext):
while not self._stop_event.is_set():
- # Wait for half frame time
- # TODO: Consider camera image processing time to adapt waiting time
- time.sleep(0.5 / self.__video_fps)
-
# Lock buffer access
with self.__video_buffer_lock:
@@ -813,6 +808,9 @@ class LiveStream(ArFeatures.DataCaptureContext):
# Clear buffer
self.__video_buffer = None
+ # Wait 1ms
+ time.sleep(1e-3)
+
def __keep_alive(self):
"""Maintain network connection."""