v0.1.9.2(2024/07/13)

1. [APIs: do_brake.py]
   - 修改ready_to_go信号的接收逻辑,适配大负载机型
2. [APIs: do_current.py]
   - 修改ready_to_go信号的接收逻辑,适配大负载机型
   - 调整单轴测试时间为35s,适配大负载机型,调整堵转电流持续时间15s,适当减少测试时间
   - 将act信号置为False的动作放在初始化,增加程序健壮性
This commit is contained in:
2024-07-13 11:36:35 +08:00
parent fe27dbf91f
commit a66a55bcd3
3 changed files with 30 additions and 14 deletions

View File

@ -308,6 +308,8 @@ def run_rl(path, hr, md, loadsel, w2t):
_response = execution('diagnosis.open', hr, w2t, open=False, display_open=False)
md.trigger_estop()
md.reset_estop()
md.write_act(False)
sleep(1) # 让曲线彻底关闭
_response = execution('state.switch_manual', hr, w2t)
_response = execution('state.switch_motor_off', hr, w2t)
@ -334,19 +336,19 @@ def run_rl(path, hr, md, loadsel, w2t):
# 4. 开始运行程序单轴运行15s
_response = execution('rl_task.run', hr, w2t, tasks=['current'])
for i in range(3):
_t_start = time()
while True:
if md.read_ready_to_go() == 1:
md.write_act(True)
sleep(1)
md.write_act(False)
break
else:
sleep(1)
else:
w2t("未收到机器人的运行信号需要确认RL程序编写正确并正常执行...", 0, 111, 'red', 'Automatic Test')
if (time() - _t_start) // 20 > 1:
w2t("20s内未收到机器人的运行信号需要确认RL程序编写正确并正常执行...", 0, 111, 'red', 'Automatic Test')
else:
sleep(1)
# 5. 打开诊断曲线,并执行采集
sleep(7) # 保证程序已经运行起来,其实主要是为了保持电流的采集而设定
sleep(10) # 保证程序已经运行起来,其实主要是为了保持电流的采集而设定
_response = execution('diagnosis.open', hr, w2t, open=True, display_open=True)
display_pdo_params = [
{"name": "hw_joint_vel_feedback", "channel": 0},
@ -365,7 +367,9 @@ def run_rl(path, hr, md, loadsel, w2t):
]
_response = execution('diagnosis.set_params', hr, w2t, display_pdo_params=display_pdo_params)
scenario_time = 0
if number < 6 or number > 8:
if number < 6:
sleep(35)
elif number > 8:
sleep(15)
else:
_t_start = time()