From 2060d8eb156d0aceb555df95c92cff219f32b378 Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Sat, 14 Nov 2020 16:40:33 +0100 Subject: [PATCH] fixed problem with slow event server --- remote_control/measurement_server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/remote_control/measurement_server.py b/remote_control/measurement_server.py index 3954e66..a4fdd91 100644 --- a/remote_control/measurement_server.py +++ b/remote_control/measurement_server.py @@ -20,6 +20,9 @@ class MeasurementHandler(socketserver.BaseRequestHandler): while not self.server.estimator.event_queue.empty(): event = self.server.estimator.event_queue.get() self.request.sendall((json.dumps(event) + '\n').encode()) + self.server.estimator.last_event = None + time.sleep(1.0 / self.server.max_measurements_per_second) + else: # send robot position try: