Add lidar loading utility, fixup main in motorserver.

This commit is contained in:
Piv
2020-03-09 22:01:36 +10:30
parent da40ee1875
commit ef83365fd8
2 changed files with 25 additions and 4 deletions

View File

@@ -74,8 +74,11 @@ class MotorServicer(motorService_pb2_grpc.CarControlServicer):
return grpc.ssl_server_credentials([[pvtKeyBytes, pvtCertBytes]])
vehicle = Vehicle() if __name__ == '__main__' else MockVehicle()
servicer = MotorServicer(vehicle)
service_thread = Thread(target=servicer.start_server)
service_thread.start()
if __name__ == '__main__':
vehicle = Vehicle()
servicer = MotorServicer(vehicle)
# Can't remember why I do this, is it even needed?
service_thread = Thread(target=servicer.start_server)
service_thread.start()