w2tgit add .!

This commit is contained in:
2025-01-22 16:40:29 +08:00
parent 92bdf133f2
commit 6b6fa1ec71
11 changed files with 23 additions and 22 deletions

View File

@ -67,7 +67,7 @@ def initialization(path, sub, data_dirs, data_files, hr, w2t):
configs = json.load(f_config)
except Exception as Err:
clibs.insert_logdb("ERROR", "current", f"get_config: 无法打开 {local_file},获取配置文件参数错误 {Err}")
w2t(f"无法打开 {local_file}", color="red", desc="OpenFileError")
w2t(f"无法打开 {local_file}\n", color="red", desc="OpenFileError")
# 最大角速度,额定电流,减速比,额定转速
version = configs["VERSION"]
@ -158,7 +158,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
elif pon == "negative":
md.write_pon(0)
else:
w2t("configs.xlsx 中 Target 页面 B5 单元格填写不正确,检查后重新运行...", "red", "DirectionError")
w2t("configs.xlsx 中 Target 页面 B5 单元格填写不正确,检查后重新运行...\n", "red", "DirectionError")
for condition in result_dirs:
reach = condition.split("_")[0].removeprefix("reach")
@ -175,7 +175,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
for axis in range(1, 4):
if not clibs.running:
w2t("后台数据清零完成,现在可以重新运行之前停止的程序。", "red")
w2t("后台数据清零完成,现在可以重新运行之前停止的程序。\n", "red")
exit()
# for single condition test
@ -239,7 +239,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
else:
time.sleep(1)
if (time.time() - t_start) > 3:
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序编写正确并正常执行...", "red", "ReadySignalTimeoutError")
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序编写正确并正常执行...\n", "red", "ReadySignalTimeoutError")
# 4. 找出最大速度传递给RL程序最后清除相关记录
time.sleep(5) # 消除前 5s 的不稳定数据
change_curve_state(hr, True)
@ -298,7 +298,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
else:
time.sleep(1)
else:
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序配置正确并正常执行...", "red", "ReadySignalTimeoutError")
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序配置正确并正常执行...\n", "red", "ReadySignalTimeoutError")
time.sleep(5+random.randint(1, 5)) # 排除从其他位姿到零点位姿,再到轴极限位姿的时间
@ -308,7 +308,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
while flag:
time.sleep(0.05)
if time.time() - start > 20:
w2t("20s 内未触发急停,需排查......", "red", "BrakeTimeoutError")
w2t("20s 内未触发急停,需排查......\n", "red", "BrakeTimeoutError")
try:
clibs.lock.acquire(True)

View File

@ -174,7 +174,7 @@ def run_rl(path, prj_file, hr, md, sub, w2t):
for condition in conditions:
if not clibs.running:
w2t("后台数据清零完成,现在可以重新运行之前停止的程序。", "red")
w2t("后台数据清零完成,现在可以重新运行之前停止的程序。\n", "red")
exit()
number = conditions.index(condition)
@ -211,7 +211,7 @@ def run_rl(path, prj_file, hr, md, sub, w2t):
else:
time.sleep(1)
if (time.time() - t_start) > 3:
w2t("3s 内未收到机器人的运行信号需要确认RL程序和工具通信是否正常执行...", "red", "ReadySignalTimeoutError")
w2t("3s 内未收到机器人的运行信号需要确认RL程序和工具通信是否正常执行...\n", "red", "ReadySignalTimeoutError")
# 4. 执行采集
time.sleep(10) # 消除前 10s 的不稳定数据