完成了电流->转矩的转变,基本完成

This commit is contained in:
2025-01-22 16:14:19 +08:00
parent 7f815ac63e
commit 92bdf133f2
48 changed files with 662 additions and 870240 deletions

View File

@@ -66,21 +66,21 @@ def get_configs(config_file, w2t):
try:
with open(config_file, mode="r", encoding="utf-8") as f_config:
configs = json.load(f_config)
p_dir = config_file.split('/')[-2]
if not re.match("^[jJ][123]$", p_dir):
w2t("被处理的根文件夹命名必须是 [Jj][123] 的格式", "red", "DirNameError")
axis = int(p_dir[-1])
rrs = [abs(_) for _ in configs["TRANSMISSION"]["REDUCTION_RATIO_NUMERATOR"]] # 减速比rr for reduction ratio
avs = configs["MOTION"]["JOINT_MAX_SPEED"]
rr = rrs[axis-1]
av = avs[axis-1]
return av, rr
except Exception as Err:
clibs.insert_logdb("ERROR", "current", f"get_config: 无法打开 {config_file},获取配置文件参数错误 {Err}")
w2t(f"无法打开 {config_file}", color="red", desc="OpenFileError")
p_dir = config_file.split('/')[-2]
if not re.match("^[jJ][123]$", p_dir):
w2t("被处理的根文件夹命名必须是 [Jj][123] 的格式", "red", "DirNameError")
axis = int(p_dir[-1])
rrs = [abs(_) for _ in configs["TRANSMISSION"]["REDUCTION_RATIO_NUMERATOR"]] # 减速比rr for reduction ratio
avs = configs["MOTION"]["JOINT_MAX_SPEED"]
rr = rrs[axis-1]
av = avs[axis-1]
return av, rr
clibs.insert_logdb("ERROR", "current", f"get_config: 无法打开 {config_file}获取配置文件参数错误 {Err}")
w2t(f"无法打开 {config_file},或者使用了错误的机型配置文件,需检查\n", color="red", desc="OpenFileError")
def now_doing_msg(docs, flag, w2t):