From 800d345fdb318e7c0f96fdc55597a0282799a45c Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Thu, 25 Sep 2025 21:04:36 +0800
Subject: [PATCH 01/17] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=80=89=E9=A2=98?=
=?UTF-8?q?=E5=B9=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/embodied_human/README.md | 1 +
1 file changed, 1 insertion(+)
create mode 100644 src/embodied_human/README.md
diff --git a/src/embodied_human/README.md b/src/embodied_human/README.md
new file mode 100644
index 0000000000..7467c7e0ea
--- /dev/null
+++ b/src/embodied_human/README.md
@@ -0,0 +1 @@
+具身人
\ No newline at end of file
From 61e9be7aee60ab587eb9b5d1bd14b87a44982edf Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Sat, 22 Nov 2025 23:53:44 +0800
Subject: [PATCH 02/17] =?UTF-8?q?PyCharm=20=E6=96=B0=E5=BB=BA=20Flask=20?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=88=E8=99=9A=E6=8B=9F=E7=8E=AF=E5=A2=83?=
=?UTF-8?q?=E9=9A=94=E7=A6=BB=E4=BE=9D=E8=B5=96=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../humanoid_flask_3d/ templates/index.html | 10 ++++++++++
src/embodied_human/humanoid_flask_3d/app.py | 9 +++++++++
src/embodied_robot/main.py | 2 ++
3 files changed, 21 insertions(+)
create mode 100644 src/embodied_human/humanoid_flask_3d/ templates/index.html
create mode 100644 src/embodied_human/humanoid_flask_3d/app.py
diff --git a/src/embodied_human/humanoid_flask_3d/ templates/index.html b/src/embodied_human/humanoid_flask_3d/ templates/index.html
new file mode 100644
index 0000000000..566549bdf8
--- /dev/null
+++ b/src/embodied_human/humanoid_flask_3d/ templates/index.html
@@ -0,0 +1,10 @@
+
+
+
+
+ Title
+
+
+
+
+
\ No newline at end of file
diff --git a/src/embodied_human/humanoid_flask_3d/app.py b/src/embodied_human/humanoid_flask_3d/app.py
new file mode 100644
index 0000000000..5d82e842d2
--- /dev/null
+++ b/src/embodied_human/humanoid_flask_3d/app.py
@@ -0,0 +1,9 @@
+from flask import Flask
+
+app = Flask(__name__)
+
+@app.route('/')
+def hello_flask():
+ return "Hello,flask!
"
+if __name__ == '__main__':
+ app.run(debug=True)
\ No newline at end of file
diff --git a/src/embodied_robot/main.py b/src/embodied_robot/main.py
index 63dc98ba00..6a798d96e8 100644
--- a/src/embodied_robot/main.py
+++ b/src/embodied_robot/main.py
@@ -80,3 +80,5 @@ def main():
if __name__ == "__main__":
main()
+
+
From fa3bfc4609a00a4430a20a54e881382a9cc09779 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Wed, 26 Nov 2025 14:43:54 +0800
Subject: [PATCH 03/17] =?UTF-8?q?=E5=85=B7=E8=BA=AB=E4=BA=BA=203D=20?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=8E=B7=E5=8F=96=E4=B8=8E=E6=9C=AC=E5=9C=B0?=
=?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/embodied_human/humanoid_flask_3d/test_model.py | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 src/embodied_human/humanoid_flask_3d/test_model.py
diff --git a/src/embodied_human/humanoid_flask_3d/test_model.py b/src/embodied_human/humanoid_flask_3d/test_model.py
new file mode 100644
index 0000000000..2b50a1ac43
--- /dev/null
+++ b/src/embodied_human/humanoid_flask_3d/test_model.py
@@ -0,0 +1,10 @@
+import pyvista as pv
+
+# 加载source文件夹里的GLB模型
+model = pv.read("source\humanoid.glb")
+# 初始化渲染器
+plotter = pv.Plotter()
+plotter.add_mesh(model, color="skyblue", edge_color="black")
+plotter.add_axes()
+# 显示模型
+plotter.show()
\ No newline at end of file
From f6826e697679b15909408113caa3dcbcecd69899 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Wed, 3 Dec 2025 22:13:17 +0800
Subject: [PATCH 04/17] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86README.md,?=
=?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=9B=B4=E5=8A=A0=E8=AF=A6=E7=BB=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/embodied_human/README.md | 1 -
.../humanoid_flask_3d/ templates/index.html | 10 --
src/embodied_human/humanoid_flask_3d/app.py | 9 --
.../humanoid_flask_3d/test_model.py | 10 --
src/humanoid_3d_animation/README.md | 122 ++++++++++++++++++
src/humanoid_3d_animation/app.py | 10 ++
.../templates/index.html | 30 +++++
7 files changed, 162 insertions(+), 30 deletions(-)
delete mode 100644 src/embodied_human/README.md
delete mode 100644 src/embodied_human/humanoid_flask_3d/ templates/index.html
delete mode 100644 src/embodied_human/humanoid_flask_3d/app.py
delete mode 100644 src/embodied_human/humanoid_flask_3d/test_model.py
create mode 100644 src/humanoid_3d_animation/README.md
create mode 100644 src/humanoid_3d_animation/app.py
create mode 100644 src/humanoid_3d_animation/templates/index.html
diff --git a/src/embodied_human/README.md b/src/embodied_human/README.md
deleted file mode 100644
index 7467c7e0ea..0000000000
--- a/src/embodied_human/README.md
+++ /dev/null
@@ -1 +0,0 @@
-具身人
\ No newline at end of file
diff --git a/src/embodied_human/humanoid_flask_3d/ templates/index.html b/src/embodied_human/humanoid_flask_3d/ templates/index.html
deleted file mode 100644
index 566549bdf8..0000000000
--- a/src/embodied_human/humanoid_flask_3d/ templates/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- Title
-
-
-
-
-
\ No newline at end of file
diff --git a/src/embodied_human/humanoid_flask_3d/app.py b/src/embodied_human/humanoid_flask_3d/app.py
deleted file mode 100644
index 5d82e842d2..0000000000
--- a/src/embodied_human/humanoid_flask_3d/app.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from flask import Flask
-
-app = Flask(__name__)
-
-@app.route('/')
-def hello_flask():
- return "Hello,flask!"
-if __name__ == '__main__':
- app.run(debug=True)
\ No newline at end of file
diff --git a/src/embodied_human/humanoid_flask_3d/test_model.py b/src/embodied_human/humanoid_flask_3d/test_model.py
deleted file mode 100644
index 2b50a1ac43..0000000000
--- a/src/embodied_human/humanoid_flask_3d/test_model.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import pyvista as pv
-
-# 加载source文件夹里的GLB模型
-model = pv.read("source\humanoid.glb")
-# 初始化渲染器
-plotter = pv.Plotter()
-plotter.add_mesh(model, color="skyblue", edge_color="black")
-plotter.add_axes()
-# 显示模型
-plotter.show()
\ No newline at end of file
diff --git a/src/humanoid_3d_animation/README.md b/src/humanoid_3d_animation/README.md
new file mode 100644
index 0000000000..d4018ceb04
--- /dev/null
+++ b/src/humanoid_3d_animation/README.md
@@ -0,0 +1,122 @@
+# 具身人3D可视化与动作交互网页开发
+基于Python+Flask+PyVista的3D可视化系统,支持模型视角控制、颜色切换、基础动作交互,通过GitHub Pages实现公开访问。
+
+## 项目概述
+本项目以Flask为Web框架,结合PyVista/Trimesh实现具身人3D模型的Web化渲染,完成基础交互(视角旋转/缩放、颜色切换)与进阶动作控制(抬手、抬腿等预设动作),并通过GitHub完成代码管理与静态网页部署,最终实现可公开访问的具身人3D交互网页。
+
+## 环境准备
+### 开发工具
+- PyCharm(社区版):项目管理、编码与调试
+- GitHub:代码托管与Pages部署
+- Chrome/Firefox:Web功能测试
+
+### 依赖库安装
+```bash
+# 虚拟环境下执行
+pip install flask pyvista trimesh numpy
+```
+| 依赖库 | 功能说明 |
+|-------------|------------------------------|
+| flask | Web框架,实现路由与页面渲染 |
+| pyvista | 3D可视化核心,支持模型Web适配 |
+| trimesh | 模型关节控制,处理带骨骼模型 |
+| numpy | 数值计算,实现关节角度转换 |
+
+### 模型准备
+下载带骨骼绑定的具身人3D模型(GLB/FBX格式),推荐来源:
+- Sketchfab官网搜索「Free Rigged Humanoid GLB」
+- 筛选条件:Downloadable + Low Poly(<50MB)
+- 模型放置路径:项目根目录(命名为`humanoid_rigged.glb`)
+
+## 项目结构
+| 文件名/目录 | 功能描述 |
+|--------------------------|--------------------------------------------------------------|
+| `app.py` | Flask核心入口,实现首页路由与Web服务启动 |
+| `test_model.py` | 本地模型加载与关节控制测试脚本 |
+| `generate_web_model.py` | 将本地3D模型转换为Web可加载的JS文件 |
+| `generate_animations.py` | 生成预设动作(初始/抬手/抬腿)的Web模型文件 |
+| `build_static.py` | 将动态项目转换为静态网页文件,适配GitHub Pages部署 |
+| `templates/index.html` | 网页模板,包含UI布局、交互按钮、3D渲染容器 |
+| `static/js/3d_render.js` | 3D渲染核心脚本,实现模型加载、颜色切换、动作交互 |
+| `static/js/*.js` | 自动生成的模型Web文件(基础模型+动作模型) |
+| `static_site/` | 静态网页输出目录,用于GitHub Pages部署 |
+| `README.md` | 项目说明文档 |
+
+## 核心功能
+### 1. 基础3D可视化(Web端)
+- 模型渲染:加载带关节的具身人3D模型,支持Web端流畅显示
+- 视角交互:鼠标拖拽旋转模型、滚轮缩放视角
+- 颜色切换:一键切换模型颜色(蓝色/绿色/粉色)
+
+### 2. 动作交互控制
+- 预设动作:支持初始姿态、抬手、抬腿3种基础动作切换
+- 关节控制:基于Trimesh修改模型关节角度,实现精准动作控制
+- 动作适配:所有动作模型预生成Web文件,保证前端加载效率
+
+### 3. 工程化部署
+- 代码管理:通过GitHub实现版本控制,支持代码同步与回溯
+- 静态部署:生成纯静态网页文件,通过GitHub Pages实现公开访问
+
+## 使用方法
+### 本地开发与测试
+#### 步骤1:环境与模型验证
+```bash
+# 测试本地模型加载
+python test_model.py
+```
+验证效果:弹出3D窗口显示模型,终端输出关节列表。
+
+#### 步骤2:生成Web模型文件
+```bash
+# 生成基础模型Web文件
+python generate_web_model.py
+# 生成动作模型Web文件
+python generate_animations.py
+```
+生成结果:`static/js/`目录下新增`humanoid_base.js`、`anim_*.js`文件。
+
+#### 步骤3:启动本地Web服务
+```bash
+python app.py
+```
+访问地址:`http://127.0.0.1:5000`
+验证功能:
+- 模型正常渲染,支持视角交互
+- 颜色按钮切换模型颜色
+- 动作按钮切换初始/抬手/抬腿姿态
+
+### GitHub部署(公开访问)
+#### 步骤1:生成静态文件
+```bash
+python build_static.py
+```
+生成结果:项目根目录新增`static_site/`,包含完整静态网页文件。
+
+#### 步骤2:GitHub Pages部署
+1. 打开项目GitHub仓库 → Settings → Pages
+2. 选择「Upload your files」,上传`static_site/`内所有文件
+3. 等待5-10分钟,访问仓库Pages链接即可公开访问
+
+## 交互操作指南
+| 操作类型 | 操作方式 | 效果说明 |
+|----------------|-----------------------------------|------------------------------|
+| 视角控制 | 鼠标拖拽模型区域 | 360°旋转模型视角 |
+| 缩放控制 | 滚轮滚动模型区域 | 放大/缩小模型显示比例 |
+| 颜色切换 | 点击「蓝色/绿色/粉色」按钮 | 实时切换模型主体颜色 |
+| 动作切换 | 点击「初始姿态/抬手/抬腿」按钮 | 切换模型至对应预设动作姿态 |
+
+## 常见问题与解决方案
+| 问题现象 | 原因分析 | 解决方法 |
+|------------------------|-----------------------------------|---------------------------------------------------------------|
+| 模型加载失败 | 模型格式错误/路径错误 | 确认模型为GLB/FBX带关节格式,检查代码中模型文件名是否匹配 |
+| 动作切换无效果 | 关节名称不匹配 | 运行`test_model.py`查看实际关节名,修改`generate_animations.py`中关节配置 |
+| GitHub Pages访问异常 | 文件路径错误/部署未完成 | 检查`static_site/`文件完整性,等待部署完成后清除浏览器缓存重试 |
+| Web渲染卡顿 | 模型面数过多 | 更换Low Poly模型,或用Blender简化模型面数 |
+
+
+## 参考资料
+- [Flask官方文档](https://flask.palletsprojects.com/)
+- [PyVista Web可视化文档](https://docs.pyvista.org/guide/web/index.html)
+- [Trimesh模型操作文档](https://trimsh.org/)
+- [GitHub Pages部署指南](https://docs.github.com/zh/pages)
+- [Sketchfab免费3D模型资源](https://sketchfab.com/)
\ No newline at end of file
diff --git a/src/humanoid_3d_animation/app.py b/src/humanoid_3d_animation/app.py
new file mode 100644
index 0000000000..5ea72608df
--- /dev/null
+++ b/src/humanoid_3d_animation/app.py
@@ -0,0 +1,10 @@
+from flask import Flask, render_template
+
+app = Flask(__name__)
+
+@app.route('/')
+def index():
+ return render_template('index.html')
+
+if __name__ == '__main__':
+ app.run(debug=True)
\ No newline at end of file
diff --git a/src/humanoid_3d_animation/templates/index.html b/src/humanoid_3d_animation/templates/index.html
new file mode 100644
index 0000000000..d52dd6c1bf
--- /dev/null
+++ b/src/humanoid_3d_animation/templates/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+ 具身人3D可视化与动作交互系统
+
+
+
+ 具身人3D可视化与动作交互系统
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 458a4e37110c0bd638d19c5bf0b671e8d98c410d Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Wed, 3 Dec 2025 22:21:03 +0800
Subject: [PATCH 05/17] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=9C=BA=E5=99=A8?=
=?UTF-8?q?=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../create_robot_model.py | 159 ++++++++++++++++++
1 file changed, 159 insertions(+)
create mode 100644 src/humanoid_3d_animation/create_robot_model.py
diff --git a/src/humanoid_3d_animation/create_robot_model.py b/src/humanoid_3d_animation/create_robot_model.py
new file mode 100644
index 0000000000..37776e2587
--- /dev/null
+++ b/src/humanoid_3d_animation/create_robot_model.py
@@ -0,0 +1,159 @@
+import pyvista as pv
+import numpy as np
+import vtk
+
+
+
+# 生成更像人形的仿真机器人模型(优化比例+结构)
+def create_robot(return_parts=False):
+ # 1. 躯干(更修长,接近人形)
+ torso = pv.Cube(center=(0, 0, 0.8), x_length=0.4, y_length=0.3, z_length=1.2)
+ torso["part_id"] = np.zeros(torso.n_points, dtype=int) # 躯干ID=0
+
+ # 2. 头部(新增,更像人形)
+ head = pv.Cube(center=(0, 0, 1.6), x_length=0.3, y_length=0.3, z_length=0.3)
+ head["part_id"] = np.full(head.n_points, 5, dtype=int) # 头部ID=5
+
+ # 3. 右胳膊(上臂+前臂,比例优化)
+ right_upper_arm = pv.Cube(center=(0.5, 0, 1.0), x_length=0.2, y_length=0.2, z_length=0.5)
+ right_upper_arm["part_id"] = np.ones(right_upper_arm.n_points, dtype=int) # 右上臂ID=1
+ right_forearm = pv.Cube(center=(0.9, 0, 1.0), x_length=0.2, y_length=0.2, z_length=0.5)
+ right_forearm["part_id"] = np.full(right_forearm.n_points, 2, dtype=int) # 右前臂ID=2
+
+ # 4. 左胳膊(新增,对称结构)
+ left_upper_arm = pv.Cube(center=(-0.5, 0, 1.0), x_length=0.2, y_length=0.2, z_length=0.5)
+ left_upper_arm["part_id"] = np.full(left_upper_arm.n_points, 6, dtype=int) # 左上臂ID=6
+ left_forearm = pv.Cube(center=(-0.9, 0, 1.0), x_length=0.2, y_length=0.2, z_length=0.5)
+ left_forearm["part_id"] = np.full(left_forearm.n_points, 7, dtype=int) # 左前臂ID=7
+
+ # 5. 右大腿+小腿(比例优化)
+ right_thigh = pv.Cube(center=(0.2, 0, -0.2), x_length=0.2, y_length=0.2, z_length=0.6)
+ right_thigh["part_id"] = np.full(right_thigh.n_points, 8, dtype=int) # 右大腿ID=8
+ right_calf = pv.Cube(center=(0.2, 0, -0.8), x_length=0.2, y_length=0.2, z_length=0.6)
+ right_calf["part_id"] = np.full(right_calf.n_points, 9, dtype=int) # 右小腿ID=9
+
+ # 6. 左大腿+小腿(比例优化)
+ left_thigh = pv.Cube(center=(-0.2, 0, -0.2), x_length=0.2, y_length=0.2, z_length=0.6)
+ left_thigh["part_id"] = np.full(left_thigh.n_points, 3, dtype=int) # 左大腿ID=3
+ left_calf = pv.Cube(center=(-0.2, 0, -0.8), x_length=0.2, y_length=0.2, z_length=0.6)
+ left_calf["part_id"] = np.full(left_calf.n_points, 4, dtype=int) # 左小腿ID=4
+
+ # 用MultiBlock合并所有部件
+ block = pv.MultiBlock()
+ block.append(torso)
+ block.append(head)
+ block.append(right_upper_arm)
+ block.append(right_forearm)
+ block.append(left_upper_arm)
+ block.append(left_forearm)
+ block.append(right_thigh)
+ block.append(right_calf)
+ block.append(left_thigh)
+ block.append(left_calf)
+
+ # 转换为单个UnstructuredGrid
+ robot = block.combine()
+
+ # 添加关节标记(右肘、左膝)
+ robot.point_data["joints"] = np.zeros(robot.n_points, dtype=int)
+ # 右肘关节(右上臂+右前臂连接点)
+ elbow_idx = robot.find_closest_point((0.7, 0, 1.0))
+ robot.point_data["joints"][elbow_idx] = 1
+ # 左膝关节(左大腿+左小腿连接点)
+ knee_idx = robot.find_closest_point((-0.2, 0, -0.5))
+ robot.point_data["joints"][knee_idx] = 1
+
+ if return_parts:
+ return robot, [torso, head, right_upper_arm, right_forearm, left_upper_arm, left_forearm, right_thigh,
+ right_calf, left_thigh, left_calf]
+ return robot
+
+
+# 关节旋转函数(保持逻辑,适配新部件ID)
+def rotate_joint(robot, joint_name, angle_deg):
+ joint_config = {
+ "right_elbow": {
+ "center": (0.7, 0, 1.0), # 右肘关节中心点
+ "target_part": 2 # 右前臂ID=2
+ },
+ "left_knee": {
+ "center": (-0.2, 0, -0.5), # 左膝关节中心点
+ "target_part": 4 # 左小腿ID=4
+ }
+ }
+
+ if joint_name not in joint_config:
+ print(f"错误:关节名称{joint_name}不存在!")
+ return robot
+
+ config = joint_config[joint_name]
+ part_mask = robot["part_id"] == config["target_part"]
+ if not np.any(part_mask):
+ print(f"错误:未找到part_id={config['target_part']}的部件!")
+ return robot
+
+ # 旋转逻辑(与之前一致)
+ target_points = robot.points[part_mask].copy()
+ vtk_points = vtk.vtkPoints()
+ for point in target_points:
+ vtk_points.InsertNextPoint(point)
+
+ transform = vtk.vtkTransform()
+ transform.Translate(config["center"][0], config["center"][1], config["center"][2])
+ transform.RotateY(angle_deg)
+ transform.Translate(-config["center"][0], -config["center"][1], -config["center"][2])
+
+ transform_filter = vtk.vtkTransformFilter()
+ transform_filter.SetTransform(transform)
+ poly_data = vtk.vtkPolyData()
+ poly_data.SetPoints(vtk_points)
+ transform_filter.SetInputData(poly_data)
+ transform_filter.Update()
+
+ rotated_vtk_points = transform_filter.GetOutput().GetPoints()
+ rotated_points = np.array([rotated_vtk_points.GetPoint(i) for i in range(rotated_vtk_points.GetNumberOfPoints())])
+ robot.points[part_mask] = rotated_points
+ return robot
+
+
+# 本地测试
+if __name__ == "__main__":
+ robot_initial = create_robot()
+ print(f"初始模型:{robot_initial.n_points}个点,{robot_initial.n_cells}个面")
+
+ # 测试右肘+左膝旋转
+ robot_rotated = rotate_joint(robot_initial.copy(), "right_elbow", 90)
+ robot_rotated = rotate_joint(robot_rotated, "left_knee", 60)
+
+ # 渲染对比
+ plotter = pv.Plotter(shape=(1, 2), window_size=(1200, 600))
+ # 左窗口:初始姿态
+ plotter.subplot(0, 0)
+ plotter.add_mesh(
+ robot_initial,
+ scalars="part_id",
+ cmap="tab10", # 更多颜色区分部件
+ edge_color="black",
+ show_edges=True,
+ scalar_bar_args={"title": "部件ID"}
+ )
+ plotter.add_axes()
+ grid = pv.Plane(center=(0, 0, -1.2), i_size=3, j_size=3, i_resolution=10, j_resolution=10)
+ plotter.add_mesh(grid, color="lightgray", opacity=0.5)
+ plotter.add_text("初始人形机器人", font_size=14, position="upper_left")
+
+ # 右窗口:旋转后姿态
+ plotter.subplot(0, 1)
+ plotter.add_mesh(
+ robot_rotated,
+ scalars="part_id",
+ cmap="tab10",
+ edge_color="black",
+ show_edges=True,
+ scalar_bar_args={"title": "部件ID"}
+ )
+ plotter.add_axes()
+ plotter.add_mesh(grid, color="lightgray", opacity=0.5)
+ plotter.add_text("抬臂+屈膝动作", font_size=14, position="upper_left")
+
+ plotter.show()
\ No newline at end of file
From a42576b157d16d3bd1bf1fb3de2424895ae02c2a Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Wed, 3 Dec 2025 22:25:29 +0800
Subject: [PATCH 06/17] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=9C=BA=E5=99=A8?=
=?UTF-8?q?=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/create_robot_model.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/humanoid_3d_animation/create_robot_model.py b/src/humanoid_3d_animation/create_robot_model.py
index 37776e2587..0e1fe04495 100644
--- a/src/humanoid_3d_animation/create_robot_model.py
+++ b/src/humanoid_3d_animation/create_robot_model.py
@@ -2,8 +2,6 @@
import numpy as np
import vtk
-
-
# 生成更像人形的仿真机器人模型(优化比例+结构)
def create_robot(return_parts=False):
# 1. 躯干(更修长,接近人形)
From 2a524953ab5be4b7fb713fcce423ae504f8a2100 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 15:36:08 +0800
Subject: [PATCH 07/17] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=9C=BA=E5=99=A8?=
=?UTF-8?q?=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../templates/humanoid.xml | 108 ++++++++++++++++++
.../templates/test_humanoid.py | 21 ++++
2 files changed, 129 insertions(+)
create mode 100644 src/humanoid_3d_animation/templates/humanoid.xml
create mode 100644 src/humanoid_3d_animation/templates/test_humanoid.py
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
new file mode 100644
index 0000000000..d24886da27
--- /dev/null
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
new file mode 100644
index 0000000000..c456470573
--- /dev/null
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -0,0 +1,21 @@
+import mujoco
+import mujoco.viewer as viewer
+import time
+
+# 加载模型
+model = mujoco.MjModel.from_xml_path("humanoid.xml")
+data = mujoco.MjData(model)
+
+# 启动可视化界面
+with viewer.launch_passive(model, data) as v:
+ # 仿真循环
+ while v.is_running():
+ step_start = time.time()
+ # 执行一步仿真
+ mujoco.mj_step(model, data)
+ # 同步帧率
+ time_until_next_step = model.opt.timestep - (time.time() - step_start)
+ if time_until_next_step > 0:
+ time.sleep(time_until_next_step)
+ # 更新视图
+ v.sync()
From a6b6918f1c36e390764d1b4c312437447cec2216 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 15:38:29 +0800
Subject: [PATCH 08/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/test_humanoid.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index c456470573..26aa4c1dc1 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -18,4 +18,4 @@
if time_until_next_step > 0:
time.sleep(time_until_next_step)
# 更新视图
- v.sync()
+ v.sync()
\ No newline at end of file
From 277c6b3a8cd3245d6786747a62cb8a7708691e80 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 15:43:35 +0800
Subject: [PATCH 09/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 +
src/humanoid_3d_animation/templates/test_humanoid.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index d24886da27..566aab04ae 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,6 +2,7 @@
+
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 26aa4c1dc1..55a1cb63d0 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -6,6 +6,7 @@
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
+
# 启动可视化界面
with viewer.launch_passive(model, data) as v:
# 仿真循环
From 9b84174dff70e76013ea727471b2039dfb778dcf Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 15:51:43 +0800
Subject: [PATCH 10/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 -
src/humanoid_3d_animation/templates/test_humanoid.py | 2 --
2 files changed, 3 deletions(-)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index 566aab04ae..d24886da27 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,7 +2,6 @@
-
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 55a1cb63d0..e2619424d2 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -5,8 +5,6 @@
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
-
-
# 启动可视化界面
with viewer.launch_passive(model, data) as v:
# 仿真循环
From d4fb601fb3fd2494c09ad9ae3cf730fe100d0638 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 15:54:14 +0800
Subject: [PATCH 11/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/test_humanoid.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index e2619424d2..26aa4c1dc1 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -5,6 +5,7 @@
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
+
# 启动可视化界面
with viewer.launch_passive(model, data) as v:
# 仿真循环
From 3bacbda5cdede8143fef67e6b862ca1e40d7fbb0 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:22:25 +0800
Subject: [PATCH 12/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 +
src/humanoid_3d_animation/templates/test_humanoid.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index d24886da27..566aab04ae 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,6 +2,7 @@
+
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 26aa4c1dc1..501b79b785 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -2,6 +2,7 @@
import mujoco.viewer as viewer
import time
+
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
From 549b29880ef4e80f207f7288a374b8feab58dcd5 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:25:44 +0800
Subject: [PATCH 13/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 -
src/humanoid_3d_animation/templates/test_humanoid.py | 2 --
2 files changed, 3 deletions(-)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index 566aab04ae..d24886da27 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,7 +2,6 @@
-
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 501b79b785..3425518e82 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -1,8 +1,6 @@
import mujoco
import mujoco.viewer as viewer
import time
-
-
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
From 528cdfa0264fd62fb31f466d5dfafea7469884ad Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:26:39 +0800
Subject: [PATCH 14/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 +
src/humanoid_3d_animation/templates/test_humanoid.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index d24886da27..566aab04ae 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,6 +2,7 @@
+
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 3425518e82..26aa4c1dc1 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -1,6 +1,7 @@
import mujoco
import mujoco.viewer as viewer
import time
+
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
From 3f205a652596b54b5b5191150dcef0d2acc3d494 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:29:26 +0800
Subject: [PATCH 15/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 -
src/humanoid_3d_animation/templates/test_humanoid.py | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index 566aab04ae..d24886da27 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,7 +2,6 @@
-
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 26aa4c1dc1..3425518e82 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -1,7 +1,6 @@
import mujoco
import mujoco.viewer as viewer
import time
-
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
From 2ed4ff602043137b8b88e919e71ae4d6dd9ee6d8 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:35:01 +0800
Subject: [PATCH 16/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 +
src/humanoid_3d_animation/templates/test_humanoid.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index d24886da27..566aab04ae 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,6 +2,7 @@
+
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 3425518e82..26aa4c1dc1 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -1,6 +1,7 @@
import mujoco
import mujoco.viewer as viewer
import time
+
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)
From 4fc6dce1ec269d21feb4ab8897590d674daae856 Mon Sep 17 00:00:00 2001
From: oyzw2302
Date: Fri, 19 Dec 2025 16:43:19 +0800
Subject: [PATCH 17/17] =?UTF-8?q?=E5=88=9B=E5=BB=BAmujoco=E6=9C=BA?=
=?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/humanoid_3d_animation/templates/humanoid.xml | 1 -
src/humanoid_3d_animation/templates/test_humanoid.py | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/humanoid_3d_animation/templates/humanoid.xml b/src/humanoid_3d_animation/templates/humanoid.xml
index 566aab04ae..d24886da27 100644
--- a/src/humanoid_3d_animation/templates/humanoid.xml
+++ b/src/humanoid_3d_animation/templates/humanoid.xml
@@ -2,7 +2,6 @@
-
diff --git a/src/humanoid_3d_animation/templates/test_humanoid.py b/src/humanoid_3d_animation/templates/test_humanoid.py
index 26aa4c1dc1..3425518e82 100644
--- a/src/humanoid_3d_animation/templates/test_humanoid.py
+++ b/src/humanoid_3d_animation/templates/test_humanoid.py
@@ -1,7 +1,6 @@
import mujoco
import mujoco.viewer as viewer
import time
-
# 加载模型
model = mujoco.MjModel.from_xml_path("humanoid.xml")
data = mujoco.MjData(model)