Use PAIR socket for slam, tidy up python stuff.

This commit is contained in:
Piv
2020-02-06 21:21:33 +10:30
parent 24bd93043e
commit 3b6df222eb
2 changed files with 11 additions and 5 deletions

View File

@@ -31,6 +31,10 @@ class SlamStreamer:
to calling this method, and changing those values after
calling this method will have no effect.
'''
# Block until user opens zmq.
self._socket.recv()
# Adapted from BreezySLAM rpslam example.
# Connect to Lidar unit
lidar = Lidar(self._lidar_connection)
@@ -77,7 +81,7 @@ class SlamStreamer:
return zmq.Context.instance()
def _create_tcp_pub_socket(self):
return self._create_context().socket(zmq.PUB)
return self._create_context().socket(zmq.PAIR)
def _start_socket(self, socket, port):
socket.bind('tcp://*:' + str(self._port))