feat: 增加动作队列

This commit is contained in:
bmy
2024-06-16 17:28:00 +08:00
parent f5be160fd9
commit 0a0e597fe9
3 changed files with 131 additions and 12 deletions

14
main.py
View File

@@ -18,6 +18,12 @@ cfg_main = toml.load('cfg_main.toml')
# 配置日志输出
logger.add(cfg_main['debug']['logger_filename'], format=cfg_main['debug']['logger_format'], retention = 5, level="INFO")
act.cmd.camera(180)
act.cmd.x2(1, 140)
act.cmd.storage(20)
act.cmd.scoop(25)
# 向任务队列添加任务
task_queue = queue.Queue()
if cfg_main['task']['Subtask_enable'] is True:
@@ -47,14 +53,6 @@ def worker_thread():
# 启动工作线程
worker = threading.Thread(target=worker_thread, daemon=True)
worker.start()
# if (cmd_py_obj.send_angle_camera(180) == -1):
# cmd_py_obj.send_angle_camera(180)
cmd_py_obj.send_position_axis_x(1, 140)
time.sleep(0.5)
cmd_py_obj.send_angle_storage(20)
time.sleep(0.5)
cmd_py_obj.send_angle_scoop(25)
time.sleep(2)
# 创建主任务
main_task_t = mj.main_task(cmd_py_obj) # 初始化时传入 zmq socket 对象