Fix location, don't print whole map.

This commit is contained in:
Piv
2020-02-17 22:24:59 +10:30
parent 8d4007dab2
commit ced8dea67b

View File

@@ -72,7 +72,6 @@ class SlamStreamer:
slam.update(distances, scan_angles_degrees=angles) slam.update(distances, scan_angles_degrees=angles)
print('Map updated') print('Map updated')
slam.getmap(mapbytes) slam.getmap(mapbytes)
print(mapbytes)
self._push_map(mapbytes, slam.getpos()) self._push_map(mapbytes, slam.getpos())
def _push_map(self, mapbytes, location): def _push_map(self, mapbytes, location):
@@ -82,7 +81,7 @@ class SlamStreamer:
location should be a tuple, the result of slam.getpos() location should be a tuple, the result of slam.getpos()
''' '''
protoScan = SlamScan(map=bytes(mapbytes), protoScan = SlamScan(map=bytes(mapbytes),
location=SlamLocation(x=location[0], y=location[1], theta=location[3])) location=SlamLocation(x=location[0], y=location[1], theta=location[2]))
print('Sending map') print('Sending map')
self._socket.send_multipart(b'slam_map', protoScan.SerializeToString()) self._socket.send_multipart(b'slam_map', protoScan.SerializeToString())