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: