added grid move to measurement server
This commit is contained in:
parent
2dc3eef2d6
commit
c65dcce176
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user