Use multiprocessing for slam, add more debug prints
This commit is contained in:
@@ -32,6 +32,7 @@ class SlamStreamer:
|
||||
calling this method will have no effect.
|
||||
'''
|
||||
|
||||
print('Starting to stream')
|
||||
self._socket = self._start_socket(self._create_socket(self._zmq_context), self._port)
|
||||
|
||||
# Block until user opens zmq.
|
||||
@@ -60,10 +61,10 @@ class SlamStreamer:
|
||||
# Extract distances and angles from triples
|
||||
distances = [item[2] for item in items]
|
||||
angles = [item[1] for item in items]
|
||||
|
||||
print('Updating map')
|
||||
# Update SLAM with current Lidar scan and scan angles
|
||||
slam.update(distances, scan_angles_degrees=angles)
|
||||
|
||||
print('Map updated')
|
||||
self._push_map(slam.getmap(mapbytes), slam.getpos())
|
||||
|
||||
def _push_map(self, mapbytes, location):
|
||||
@@ -74,6 +75,7 @@ class SlamStreamer:
|
||||
'''
|
||||
protoScan = SlamScan(map = bytes(mapbytes), \
|
||||
location = SlamLocation(x = location[0], y = location[1], theta = location[3]))
|
||||
print('Sending map')
|
||||
self._socket.send(protoScan.SerializeToString())
|
||||
|
||||
def stop_scanning(self):
|
||||
|
||||
Reference in New Issue
Block a user