FInal fixes to move to message factory
This commit is contained in:
@@ -4,6 +4,8 @@ from threading import Thread
|
||||
from persontracking import algorithms
|
||||
import persontracking.lidar_tracker_pb2 as tracker_pb
|
||||
import zmq
|
||||
import Messaging.message_factory as mf
|
||||
import Messaging.messages as messages
|
||||
|
||||
|
||||
class LidarCache():
|
||||
@@ -36,8 +38,7 @@ class LidarCache():
|
||||
Performs a scan for the given number of iterations.
|
||||
'''
|
||||
# Create the 0MQ socket first. This should not be passed between threads.
|
||||
self._socket = self._create_socket()
|
||||
self._socket.bind("tcp://*:" + str(self.port))
|
||||
self._mFactory = mf.getZmqPubSubStreamer(self.port)
|
||||
|
||||
for i, scan in enumerate(self.lidar.iter_scans(min_len=self.measurements)):
|
||||
print('%d: Got %d measurments' % (i, len(scan)))
|
||||
@@ -53,7 +54,8 @@ class LidarCache():
|
||||
|
||||
def fireGroupsChanged(self):
|
||||
# Send the updated groups to 0MQ socket.
|
||||
self._socket.send_multipart(["lidar_map", tracker_pb.PointScan(points=[]).SerializeToString()])
|
||||
self._mFactory.send_message_topic("lidar_map", messages.ProtoMessage(
|
||||
message=tracker_pb.PointScan(points=[]).SerializeToString()))
|
||||
|
||||
def stop_scanning(self):
|
||||
self.run = False
|
||||
|
||||
Reference in New Issue
Block a user