优化自动测试
This commit is contained in:
@ -151,7 +151,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
|
||||
pon = ws.cell(row=5, column=2).value
|
||||
io_name = ws.cell(row=6, column=2).value.upper()
|
||||
wb.close()
|
||||
w2t(f"基本参数配置:write_diagnosis = {write_diagnosis}, get_init_speed = {get_init_speed}, single_brake = {single_brake}, pon = {pon}\n")
|
||||
w2t(f"基本参数配置:write_diagnosis(废弃) = {write_diagnosis}, get_init_speed = {get_init_speed}, single_brake = {single_brake}, pon = {pon}\n")
|
||||
|
||||
if pon == "positive":
|
||||
md.write_pon(1)
|
||||
@ -198,7 +198,6 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
|
||||
md.r_reset_estop()
|
||||
md.r_clear_alarm()
|
||||
md.write_act(0)
|
||||
time.sleep(write_diagnosis) # 急停超差后,等待写诊断时间,可通过configs.xlsx配置,2.3 版本之后设置为 0 即可
|
||||
|
||||
while count % 3 == 1:
|
||||
# 2. 修改要执行的场景
|
||||
@ -238,8 +237,8 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
|
||||
break
|
||||
else:
|
||||
time.sleep(1)
|
||||
if (time.time() - t_start) > 3:
|
||||
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序编写正确并正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
if (time.time() - t_start) > 15:
|
||||
w2t("15s 内未收到机器人的运行信号,需要确认 RL 程序编写正确并正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
# 4. 找出最大速度,传递给RL程序,最后清除相关记录
|
||||
time.sleep(5) # 消除前 5s 的不稳定数据
|
||||
change_curve_state(hr, True)
|
||||
@ -290,17 +289,28 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
|
||||
hr.execution("rl_task.pp_to_main", tasks=["brake"])
|
||||
hr.execution("state.switch_auto")
|
||||
hr.execution("state.switch_motor_on")
|
||||
hr.execution("rl_task.run", tasks=["brake"])
|
||||
for i in range(3):
|
||||
t_start = time.time()
|
||||
while 1:
|
||||
md.r_clear_alarm()
|
||||
hr.execution("rl_task.run", tasks=["brake"])
|
||||
time.sleep(1)
|
||||
if md.w_program_state == 1:
|
||||
break
|
||||
else:
|
||||
time.sleep(5)
|
||||
if time.time() - t_start > 60:
|
||||
w2t("60s 内程序未能正常执行,需检查...\n", "red", "RlProgramStartTimeout")
|
||||
|
||||
for i in range(16):
|
||||
if md.read_ready_to_go() == 1:
|
||||
md.write_act(1)
|
||||
break
|
||||
else:
|
||||
time.sleep(1)
|
||||
else:
|
||||
w2t("3s 内未收到机器人的运行信号,需要确认 RL 程序配置正确并正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
w2t("16s 内未收到机器人的运行信号,需要确认 RL 程序配置正确并正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
|
||||
time.sleep(5+random.randint(1, 5)) # 排除从其他位姿到零点位姿,再到轴极限位姿的时间
|
||||
time.sleep(11) # 排除从其他位姿到零点位姿,再到轴极限位姿的时间
|
||||
|
||||
def exec_brake():
|
||||
flag, start, data, record = True, time.time(), None, None
|
||||
@ -337,6 +347,7 @@ def run_rl(path, sub, hr, md, config_file, prj_file, result_dirs, avs, w2t):
|
||||
if ret != "retry":
|
||||
clibs.count = 0
|
||||
break
|
||||
|
||||
else:
|
||||
w2t(f"\n{sub.removeprefix('tool')}%负载的制动性能测试执行完毕,如需采集其他负载,须切换负载类型,并更换其他负载,重新执行。\n", "green")
|
||||
|
||||
|
@ -210,8 +210,8 @@ def run_rl(path, prj_file, hr, md, sub, w2t):
|
||||
break
|
||||
else:
|
||||
time.sleep(1)
|
||||
if (time.time() - t_start) > 3:
|
||||
w2t("3s 内未收到机器人的运行信号,需要确认RL程序和工具通信是否正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
if (time.time() - t_start) > 15:
|
||||
w2t("15s 内未收到机器人的运行信号,需要确认RL程序和工具通信是否正常执行...\n", "red", "ReadySignalTimeoutError")
|
||||
|
||||
# 4. 执行采集
|
||||
time.sleep(10) # 消除前 10s 的不稳定数据
|
||||
|
Reference in New Issue
Block a user