forked from Telos4/RoboRally
fixed problem with slow event server
This commit is contained in:
parent
708284749d
commit
2060d8eb15
|
@ -20,6 +20,9 @@ class MeasurementHandler(socketserver.BaseRequestHandler):
|
||||||
while not self.server.estimator.event_queue.empty():
|
while not self.server.estimator.event_queue.empty():
|
||||||
event = self.server.estimator.event_queue.get()
|
event = self.server.estimator.event_queue.get()
|
||||||
self.request.sendall((json.dumps(event) + '\n').encode())
|
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:
|
else:
|
||||||
# send robot position
|
# send robot position
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user