added grid move to measurement server

This commit is contained in:
Simon Pirkelmann 2021-09-07 00:23:36 +02:00
parent 2dc3eef2d6
commit c65dcce176

View File

@ -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: