Tidy up lidar classes
This commit is contained in:
@@ -59,6 +59,3 @@ class LidarCache():
|
|||||||
|
|
||||||
def stop_scanning(self):
|
def stop_scanning(self):
|
||||||
self.run = False
|
self.run = False
|
||||||
|
|
||||||
def _create_socket(self):
|
|
||||||
return zmq.Context.instance().socket(zmq.PUB)
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from multiprocessing import Process
|
|||||||
|
|
||||||
|
|
||||||
class LidarServicer(PersonTrackingServicer):
|
class LidarServicer(PersonTrackingServicer):
|
||||||
lidar_thread = None
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.cache = LidarCache(measurements=100)
|
self.cache = LidarCache(measurements=100)
|
||||||
@@ -15,12 +14,9 @@ class LidarServicer(PersonTrackingServicer):
|
|||||||
|
|
||||||
def stop_tracking(self, request, context):
|
def stop_tracking(self, request, context):
|
||||||
self.cache.stop_scanning()
|
self.cache.stop_scanning()
|
||||||
self.lidar_thread.join()
|
|
||||||
self.lidar_thread = None
|
|
||||||
|
|
||||||
def start_tracking(self, request, context):
|
def start_tracking(self, request, context):
|
||||||
'''
|
'''
|
||||||
Starts the lidar cache.
|
Starts the lidar cache.
|
||||||
'''
|
'''
|
||||||
if self.lidar_thread is None:
|
self.cache.start_cache()
|
||||||
self.lidar_thread = Process(target=self.cache.do_scanning)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user