Repository navigation
修改了readme文件,将项目目标更改为给shadow_hand手掌建模制作动画 #3982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
38535e0
修改了readme文件,将项目目标更改为给shadow_hand手掌建模制作动画
HuangJinjie2887 a3c7b0e
Merge branch 'main' of https://github.com/HuangJinjie2887/nn
HuangJinjie2887 bc8eb41
Merge branch 'main' of https://github.com/HuangJinjie2887/nn
HuangJinjie2887 e80f4ae
Merge branch 'main' of https://github.com/HuangJinjie2887/nn
HuangJinjie2887 02a0605
Merge branch 'main' of https://github.com/HuangJinjie2887/nn
HuangJinjie2887 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,117 @@ | ||
| # 仿人手臂 MuJoCo 仿真项目 | ||
| Shadow Hand 手部动画演示 | ||
| 项目概述 | ||
| 这是一个基于 MuJoCo 物理引擎的 Shadow Hand 手部模型动画演示程序。该脚本加载 Shadow Hand 的 MJCF 模型文件,并通过简单的控制指令循环展示三种不同的手部姿态。 | ||
|
|
||
| ## 项目结构 | ||
| 所有文件均位于 `src/Embodied_Human_Arm_Modeling/` 目录内。 | ||
| 功能特性 | ||
| 模型加载:加载 Shadow Hand 的 MJCF 模型文件(left_hand.xml) | ||
|
|
||
| ## 可用文件 | ||
| 姿态控制:预定义了三种手部姿态: | ||
|
|
||
| ### 模型文件 | ||
| 1. `arm_model.xml` - 基础手臂模型(肩、肘、腕关节) | ||
| 2. simulate_full_hand.xml` - 增强版模型(含手掌、手指、传感器) | ||
| 张开手:所有关节设置为零位置 | ||
|
|
||
| ### 仿真脚本 | ||
| 1. `simulate_arm.py` - 基础仿真脚本 | ||
| 2. simulate_full_hand.py - 增强版脚本(多模式控制、数据记录) | ||
| 握拳:模拟握拳动作的关节角度 | ||
|
|
||
| 捏取:模拟捏取物体的手部姿态 | ||
|
|
||
| ## 运行方式 | ||
| 实时动画:每3秒自动切换一种姿态 | ||
|
|
||
| ### 方式1:使用启动器(推荐) | ||
| ```bash | ||
| cd src/Embodied_Human_Arm_Modeling | ||
| python simulate_full_hand.py | ||
| 可视化界面:使用 MuJoCo 的被动查看器实时显示手部动作 | ||
|
|
||
| 系统要求 | ||
| Python 3.8+ | ||
|
|
||
| MuJoCo 2.3.0+ | ||
|
|
||
| NumPy | ||
|
|
||
| 安装与运行 | ||
| 1. 安装依赖 | ||
| bash | ||
| pip install mujoco numpy | ||
| 2. 准备模型文件 | ||
| 确保 left_hand.xml 模型文件与脚本在同一目录下,或修改脚本中的路径指向正确的模型文件。 | ||
|
|
||
| 3. 运行程序 | ||
| bash | ||
| python simple_hand_animation.py | ||
| 代码说明 | ||
| 主要功能模块 | ||
| 模型加载: | ||
|
|
||
| python | ||
| model = mujoco.MjModel.from_xml_path('left_hand.xml') | ||
| data = mujoco.MjData(model) | ||
| 查看器设置: | ||
|
|
||
| python | ||
| viewer = mujoco.viewer.launch_passive(model, data) | ||
| viewer.cam.azimuth = 45 | ||
| viewer.cam.elevation = -20 | ||
| viewer.cam.distance = 0.8 | ||
| 姿态定义: | ||
|
|
||
| python | ||
| test_poses = [ | ||
| ("张开手", np.zeros(model.nu)), | ||
| ("握拳", np.array([...])), | ||
| ("捏取", np.array([...])) | ||
| ] | ||
| 动画循环: | ||
|
|
||
| 每3秒切换一个预定义姿态 | ||
|
|
||
| 实时更新控制指令并同步查看器 | ||
|
|
||
| 使用方法 | ||
| 运行程序后,MuJoCo 查看器将自动打开 | ||
|
|
||
| 手部模型将循环展示三种姿态: | ||
|
|
||
| 张开手 → 等待3秒 → 握拳 → 等待3秒 → 捏取 → 等待3秒 → 重复 | ||
|
|
||
| 按 Ctrl+C 可中断程序并关闭查看器 | ||
|
|
||
| 输出信息 | ||
| 程序运行时会输出以下信息: | ||
|
|
||
| ✅ 模型加载成功 | ||
|
|
||
| 📊 关节数: [关节数量] | ||
|
|
||
| 📊 执行器数: [执行器数量] | ||
|
|
||
| 🎭 切换到: [当前姿态名称] | ||
|
|
||
| 文件结构 | ||
| text | ||
| . | ||
| ├── simple_hand_animation.py # 主程序文件 | ||
| ├── left_hand.xml # Shadow Hand MJCF 模型文件 | ||
| └── README.md # 说明文档 | ||
| 注意事项 | ||
| 确保 MuJoCo 许可证正确配置 | ||
|
|
||
| 模型文件需与脚本在同一目录或指定正确路径 | ||
|
|
||
| 姿态控制值基于原始模型配置,可能需要根据具体模型调整 | ||
|
|
||
| 扩展设想 | ||
| 基于当前代码,未来可以: | ||
|
|
||
| 增加更多预定义手部姿态 | ||
|
|
||
| 添加手动控制模式(键盘或GUI) | ||
|
|
||
| 实现姿态间的平滑过渡动画 | ||
|
|
||
| 记录和回放手部动作序列 | ||
|
|
||
| 添加物理交互对象(如抓取小球) | ||
|
|
||
| 致谢 | ||
| Shadow Robot Company 提供开源手部模型 | ||
|
|
||
| DeepMind 开发 MuJoCo 物理引擎 | ||
|
|
||
| 许可证 | ||
| 遵循原始模型的 Apache 2.0 许可证。 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不符合markdown语法,显示异常