feat: 新增IK实时求解与运动模拟功能,集成正逆运动学查看器,补充定位图截图

This commit is contained in:
cbb
2026-09-28 12:08:41 +08:00
parent 79c1265202
commit c0c78251b5
11 changed files with 3955 additions and 25 deletions
+5 -1
View File
@@ -32,6 +32,8 @@ def rebuild_viewer():
DOCS + "/travel.json") else "[]"
screws = io.open(DOCS + "/screws.json", encoding="utf-8").read() if os.path.exists(
DOCS + "/screws.json") else "[]"
ik_solver = io.open(WEB + "/arm-ik-solver.js", encoding="utf-8").read()
ik_glue = io.open(WEB + "/ik-glue.js", encoding="utf-8").read()
tpl = io.open(SRC + "/viewer_tpl.html", encoding="utf-8").read()
print(f" 完成 ({len(data)/1024:.0f} KB) ✓", flush=True)
@@ -40,7 +42,9 @@ def rebuild_viewer():
.replace("/*__DATA__*/", data)
.replace("/*__SHEETS__*/", sheets)
.replace("/*__TRAVEL__*/", trv)
.replace("/*__SCREWS__*/", screws))
.replace("/*__SCREWS__*/", screws)
.replace("/*__IKSOLVER__*/", ik_solver)
.replace("/*__IKGLUE__*/", ik_glue))
assert "/*__" not in out, [l for l in out.split("\n") if "/*__" in l][:3]
dst = WEB + "/机器人手臂3D查看器.html"
io.open(dst, "w", encoding="utf-8").write(out)