From c65dcce17655d3067f3c478a123cf20bd2fdef06 Mon Sep 17 00:00:00 2001 From: Simon Pirkelmann Date: Tue, 7 Sep 2021 00:23:36 +0200 Subject: [PATCH] added grid move to measurement server --- remote_control/measurement_server.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/remote_control/measurement_server.py b/remote_control/measurement_server.py index 4a4cbcf..da3c462 100644 --- a/remote_control/measurement_server.py +++ b/remote_control/measurement_server.py @@ -29,6 +29,14 @@ class MeasurementHandler(socketserver.BaseRequestHandler): for corner, data in corner_estimates.items(): response[corner] = {'x': data['x'], 'y': data['y']} self.request.sendall((json.dumps(response) + '\n').encode()) + elif 'move_grid' in data.decode(): + data_decode = data.decode() + print("data: ", data_decode) + payload = data.decode().split(';')[1] + grid_pos = json.loads(payload) + print("grid_pos = ", grid_pos) + pos = self.server.estimator.get_pos_from_grid_point(grid_pos['x'], grid_pos['y'], grid_pos['orientation']) + self.server.estimator.event_queue.put(('click', {'x': pos[0], 'y': pos[1], 'angle': pos[2]})) else: # send robot position try: