forked from DigiScore/RAMI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
51 lines (41 loc) · 1.47 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import art
import logging
import time
import config
from modules.conducter import Conducter
from nebula.hivemind import DataBorg
from nebula.nebula import Nebula
if config.data_writer:
from modules.data_writer import DataWriter
class Main:
"""
Main script to start the robot arm drawing digital score work.
Conducter calls the local interpreter for project specific functions. This
communicates directly to the robot libraries.
Nebula kick-starts the AI Factory for generating NNet data and affect
flows.
This script also controls the live mic audio analyser.
Paramaters are to be modified in config.py.
"""
def __init__(self):
art.tprint("KC Plus")
# Build initial dataclass filled with random numbers
self.hivemind = DataBorg()
# Logging for all modules
logging.basicConfig(level=logging.INFO)
# Init the AI factory (inherits AIFactory, Listener)
nebula = Nebula(speed=config.speed)
# Init Conducter & Gesture management (controls XArm)
robot = Conducter(speed=config.speed)
# Init data writer
if config.data_writer:
dw = DataWriter()
# Start Nebula AI Factory after conducter starts data moving
nebula.endtime = time.time() + config.duration_of_piece
self.hivemind.running = True
robot.main_loop()
nebula.main_loop()
if config.data_writer:
dw.main_loop()
if __name__ == "__main__":
Main()