From e3f2cbd307af9949e9cedb131d54d7a4a5a8caa3 Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Thu, 5 Mar 2020 20:18:41 +1030 Subject: [PATCH] Tidy up lidar classes --- persontracking/lidar_cache.py | 3 --- persontracking/lidar_servicer.py | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/persontracking/lidar_cache.py b/persontracking/lidar_cache.py index 3f105ca..ce5c294 100644 --- a/persontracking/lidar_cache.py +++ b/persontracking/lidar_cache.py @@ -59,6 +59,3 @@ class LidarCache(): def stop_scanning(self): self.run = False - - def _create_socket(self): - return zmq.Context.instance().socket(zmq.PUB) diff --git a/persontracking/lidar_servicer.py b/persontracking/lidar_servicer.py index e742670..e4a5315 100644 --- a/persontracking/lidar_servicer.py +++ b/persontracking/lidar_servicer.py @@ -5,7 +5,6 @@ from multiprocessing import Process class LidarServicer(PersonTrackingServicer): - lidar_thread = None def __init__(self): self.cache = LidarCache(measurements=100) @@ -15,12 +14,9 @@ class LidarServicer(PersonTrackingServicer): def stop_tracking(self, request, context): self.cache.stop_scanning() - self.lidar_thread.join() - self.lidar_thread = None def start_tracking(self, request, context): ''' Starts the lidar cache. ''' - if self.lidar_thread is None: - self.lidar_thread = Process(target=self.cache.do_scanning) + self.cache.start_cache()