-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_threads.py
executable file
·29 lines (27 loc) · 1.09 KB
/
start_threads.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import threading
from ultrasonic import Ultrasonic
from orientation import Orientation
from driver import Driver
from visual import Visual
from stream import Stream
import logging
ROBOT_NAME = 'Robot'
log_level = os.getenv('LOG_LEVEL', 'INFO')
logging.basicConfig(level=log_level, format='%(levelname)s | %(threadName)s | %(message)s')
if __name__ == "__main__":
ultrasonic = Ultrasonic()
orientation = Orientation()
driver = Driver()
visual = Visual()
streaming = Stream()
ultrasonic_thread = threading.Thread(name='Ultrasonic', target=ultrasonic.start, daemon=False)
orientation_thread = threading.Thread(name='Orientation', target=orientation.start, daemon=False)
driver_thread = threading.Thread(name='Driver', target=driver.start, daemon=False)
streaming_thread = threading.Thread(name='Streaming', target=streaming.start, daemon=False)
visual_thread = threading.Thread(name='Visual', target=visual.start, daemon=False)
ultrasonic_thread.start()
orientation_thread.start()
streaming_thread.start()
visual_thread.start()
driver_thread.start()