-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (55 loc) · 1.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from config.init import cfg
from loguru import logger
from controller.controller import serve
import movement.move
import time
import math
if cfg["this"] == "nano":
from sense.detect import main_cv
def _init_logger():
logger.level("DEBUG")
logger.add("./run/{time}.log", retention=5, catch=True)
logger.bind(with_traceback=True).info("With traceback")
def main():
_init_logger()
if cfg["this"] == "nano":
# use json directly pass the arguments
main_cv(cfg["cv"])
if cfg["this"] == "pi":
movement.move.perform_init()
logger.success("wait for enter to start")
# 机械臂初始化
# 正式开始程序
while True:
if input() == "":
serve()
logger.success("exit 0")
exit(0)
# serve()
# logger.success("exit 0")
# exit(0)
if __name__ == "__main__":
main()
# movement.move.move(0, 0.3, 4000, 0)
# time.sleep(1.6)
# movement.move.move(0,0.8,4000,0)
# time.sleep(2)
# movement.move.move(0,0.8,4000,0)
# time.sleep(2)
# movement.move.move(0,0.8,4000,0)
# time.sleep(2)
# movement.move.move(0,0.8,4000,0)
# time.sleep(2)
# movement.move.move(0,0.8,4000,0)
# time.sleep(2)
# movement.move.minus_3()
# movement.move.plus_1()
# time.sleep(3)
# movement.move.plus_2()
# time.sleep(3)
# movement.move.minus_2()
# time.sleep(3)
# movement.move.plus_2()
# time.sleep(3)
# movement.move.minus_1()
# time.sleep(3)