v0.1.9.0(2024/07/10)

1. 完成了制动性能的自动化采集
2. 完善了modbus浮点数读写相关的功能
3. 修改了target.zip工程,该工程目前适配电机电流和制动性能
This commit is contained in:
2024-07-10 19:18:53 +08:00
parent fa5a9f0f89
commit 40ddef1c39
6 changed files with 31 additions and 9 deletions

View File

@ -166,6 +166,8 @@ def run_rl(path, loadsel, hr, md, config_file, prj_file, result_dirs, w2t):
{"name": "device_servo_trq_feedback", "channel": 5},
{"name": "device_safety_estop", "channel": 0},
]
wb = load_workbook(config_file, read_only=True)
ws = wb['Target']
for condition in result_dirs:
_reach = condition.split('_')[0].removeprefix('reach')
_load = condition.split('_')[1].removeprefix('load')
@ -193,7 +195,12 @@ def run_rl(path, loadsel, hr, md, config_file, prj_file, result_dirs, w2t):
ssh = SSHClient()
ssh.set_missing_host_key_policy(AutoAddPolicy())
ssh.connect('192.168.0.160', 22, username='luoshi', password='luoshi2019')
_rl_cmd = f"brake_E(j{axis}_{_reach}_p, j{axis}_{_reach}_n, p_speed, p_tool)"
if ws.cell(row=1, column=1).value == 'positive':
_rl_cmd = f"brake_E(j{axis}_{_reach}_n, j{axis}_{_reach}_p, p_speed, p_tool)"
elif ws.cell(row=1, column=1).value == 'negative':
_rl_cmd = f"brake_E(j{axis}_{_reach}_p, j{axis}_{_reach}_n, p_speed, p_tool)"
else:
w2t("configs.xlsx中Target页面A1单元格填写不正确检查后重新运行...", 0, 111, 'red', 'Automatic Test')
_rl_speed = f"VelSet {_speed}"
cmd = 'cd /home/luoshi/bin/controller/; '
cmd += 'sudo sed -i "/brake_E/d" projects/target/_build/brake/main.mod; '
@ -238,8 +245,6 @@ def run_rl(path, loadsel, hr, md, config_file, prj_file, result_dirs, w2t):
if item.get('channel', None) == axis-1 and item.get('name', None) == 'hw_joint_vel_feedback':
_ = abs(RADIAN*sum(item['value'])/len(item['value']))
speed_max = max(_, speed_max)
wb = load_workbook(config_file, read_only=True)
ws = wb['Target']
speed_target = float(ws.cell(row=3, column=axis+1).value) * float(_speed) / 100
if speed_max < speed_target*0.95 or speed_max > speed_target*1.05:
w2t(f"Axis: {axis}-{count} | Speed: {speed_max} | Shouldbe: {speed_target}", 0, 0, 'indigo', 'Automatic Test')