-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (24 loc) · 973 Bytes
/
main.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
30
from dotenv import load_dotenv
load_dotenv()
import multiprocessing
import threading
from listener import start_listener
from face import start_face
from modules.mood import start_mood_controller
from controller import start_controller
def main():
expressions_queue = multiprocessing.Queue()
commands_queue = multiprocessing.Queue()
moods_queue = multiprocessing.Queue()
face_thread = threading.Thread(target=start_face, args=(expressions_queue,))
listener_thread = threading.Thread(target=start_listener, args=(commands_queue,))
mood_thread = threading.Thread(target=start_mood_controller, args=(moods_queue,))
control_thread = threading.Thread(target=start_controller, args=(commands_queue, expressions_queue, moods_queue,))
control_thread.setDaemon(True)
listener_thread.setDaemon(True)
control_thread.start()
face_thread.start()
listener_thread.start()
mood_thread.start()
if __name__ == "__main__":
main()