-
Notifications
You must be signed in to change notification settings - Fork 185
优化 humanoid_motion_control 模块路径处理,解决模型加载失败问题;添加一个main.py的例子代码;已删除git 日志文件 #2619
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d86df50
我的选题
mengdeqi12 76fa610
Merge branch 'OpenHUTB:main' into main
mengdeqi12 4810d2d
Merge branch 'OpenHUTB:main' into main
mengdeqi12 3184469
Merge branch 'OpenHUTB:main' into main
mengdeqi12 d847f22
添加我的环境配置
mengdeqi12 cb82bc4
Merge branch 'OpenHUTB:main' into main
mengdeqi12 7bf132b
Merge branch 'OpenHUTB:main' into main
mengdeqi12 46ecebc
Merge branch 'OpenHUTB:main' into main
mengdeqi12 610f122
Merge branch 'OpenHUTB:main' into main
mengdeqi12 0d5ed18
Merge branch 'OpenHUTB:main' into main
mengdeqi12 64291c7
移除.idea文件并更新.gitignore
mengdeqi12 7fc6526
彻底删除 .idea 目录
mengdeqi12 587029b
彻底移除 .idea 文件并更新 .gitignore
mengdeqi12 2404222
彻底移除 .idea 并修正 .gitignore 位置
mengdeqi12 dce2420
Merge branch 'OpenHUTB:main' into main
mengdeqi12 33e5d4b
Merge branch 'OpenHUTB:main' into main
mengdeqi12 ff2758f
机器人行走的基底模型
mengdeqi12 eddd4de
Merge branch 'main' of https://github.com/mengdeqi12/nn
mengdeqi12 491f2d1
Merge branch 'OpenHUTB:main' into main
mengdeqi12 308886a
Merge branch 'OpenHUTB:main' into main
mengdeqi12 c607e1c
feat: 优化 humanoid_motion_control 模块路径处理,解决模型加载失败问题
mengdeqi12 17c41ab
Merge branch 'OpenHUTB:main' into main
mengdeqi12 d689c29
feat: 优化 humanoid_motion_control 模块路径处理,解决模型加载失败问题
mengdeqi12 73ce4c9
Merge branch 'OpenHUTB:main' into main
mengdeqi12 a4a3ef0
feat: 优化 humanoid_motion_control 模块路径处理,解决模型加载失败问题
mengdeqi12 fb35491
Merge branch 'OpenHUTB:main' into main
mengdeqi12 c7ed4a1
Merge branch 'main' of https://github.com/mengdeqi12/nn
mengdeqi12 65a2e06
feat: 优化 humanoid_motion_control 模块路径处理,解决模型加载失败问题;改了代码我的项目的参数
mengdeqi12 19299f5
chore: 从仓库中删除 .venv 并忽略
mengdeqi12 0312bb8
Merge branch 'OpenHUTB:main' into main
mengdeqi12 8ac7ca0
chore: 从仓库移除 tatus 文件并添加到 .gitignore
mengdeqi12 1da2194
Merge branch 'OpenHUTB:main' into main
mengdeqi12 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
Binary file not shown.
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,33 +1,16 @@ | ||
具身机器人 | ||
具身机器人: | ||
|
||
环境配置: | ||
absl-py 2.3.1 | ||
cloudpickle 3.1.1 | ||
contourpy 1.3.3 | ||
cycler 0.12.1 | ||
etils 1.13.0 | ||
Farama-Notifications 0.0.4 | ||
fonttools 4.59.2 | ||
fsspec 2025.9.0 | ||
glfw 2.10.0 | ||
gymnasium 1.2.0 | ||
imageio 2.37.0 | ||
importlib_resources 6.5.2 | ||
kiwisolver 1.4.9 | ||
Markdown 3.9 | ||
matplotlib 3.10.6 | ||
mujoco 3.3.6 | ||
numpy 2.3.3 | ||
packaging 25.0 | ||
pillow 11.3.0 | ||
pip 25.2 | ||
PyOpenGL 3.1.10 | ||
pyparsing 3.2.4 | ||
python-dateutil 2.9.0.post0 | ||
python-markdown-math 0.9 | ||
six 1.17.0 | ||
typing_extensions 4.15.0 | ||
zipp 3.23.0 | ||
torch 2.8.0+cpu | ||
torchaudio 2.8.0+cpu | ||
torchvision 0.23.0+cpu | ||
1. 行走: | ||
# 核心库(必须安装) | ||
mujoco==3.3.6 | ||
numpy==2.2.6 | ||
|
||
# 间接依赖(通常自动安装,若缺失则补充) | ||
absl-py==2.3.1 | ||
glfw==2.10.0 | ||
PyOpenGL==3.1.10 | ||
etils==1.13.0 | ||
importlib_resources==6.5.2 | ||
typing_extensions==4.15.0 | ||
zipp==3.23.0 | ||
fsspec==2025.9.0 |
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 +1,82 @@ | ||
import mujoco | ||
import time | ||
from mujoco import viewer | ||
|
||
|
||
def main(): | ||
# 定义简单的双轮机器人模型 | ||
robot_xml = """ | ||
<mujoco model="simple_robot"> | ||
<option timestep="0.01"/> | ||
<worldbody> | ||
<!-- 地面 --> | ||
<body name="ground"> | ||
<geom type="plane" size="5 5 0.1" rgba="0.9 0.9 0.9 1"/> | ||
</body> | ||
|
||
<!-- 机器人主体 --> | ||
<body name="base" pos="0 0 0.1"> | ||
<inertial pos="0 0 0" mass="1.0" diaginertia="0.1 0.1 0.1"/> | ||
<geom type="box" size="0.2 0.1 0.1" rgba="0.2 0.4 0.8 1"/> | ||
|
||
<!-- 左轮 --> | ||
<body name="left_wheel" pos="0 -0.15 0"> | ||
<joint name="left_joint" type="hinge" axis="0 1 0"/> | ||
<geom type="cylinder" size="0.05 0.08" rgba="0.5 0.5 0.5 1"/> | ||
<inertial pos="0 0 0" mass="0.2" diaginertia="0.01 0.01 0.01"/> | ||
</body> | ||
|
||
<!-- 右轮 --> | ||
<body name="right_wheel" pos="0 0.15 0"> | ||
<joint name="right_joint" type="hinge" axis="0 1 0"/> | ||
<geom type="cylinder" size="0.05 0.08" rgba="0.5 0.5 0.5 1"/> | ||
<inertial pos="0 0 0" mass="0.2" diaginertia="0.01 0.01 0.01"/> | ||
</body> | ||
</body> | ||
</worldbody> | ||
|
||
<!-- 电机执行器 --> | ||
<actuator> | ||
<motor name="left_motor" joint="left_joint" gear="100"/> | ||
<motor name="right_motor" joint="right_joint" gear="100"/> | ||
</actuator> | ||
</mujoco> | ||
""" | ||
|
||
# 加载模型 | ||
model = mujoco.MjModel.from_xml_string(robot_xml) | ||
data = mujoco.MjData(model) | ||
|
||
# 初始化可视化器 | ||
viewer_instance = viewer.launch_passive(model, data) | ||
|
||
# 设置直行速度(左右轮相同速度) | ||
forward_speed = 1.0 | ||
data.ctrl[0] = forward_speed # 左轮速度 | ||
data.ctrl[1] = forward_speed # 右轮速度 | ||
|
||
# 运行仿真10秒 | ||
total_time = 10.0 | ||
steps = int(total_time / model.opt.timestep) | ||
|
||
start_time = time.time() | ||
for _ in range(steps): | ||
# 执行仿真步 | ||
mujoco.mj_step(model, data) | ||
|
||
# 更新可视化 | ||
viewer_instance.sync() | ||
|
||
# 维持实时速率 | ||
elapsed = time.time() - start_time | ||
expected = _ * model.opt.timestep | ||
if elapsed < expected: | ||
time.sleep(expected - elapsed) | ||
|
||
print(f"仿真完成,机器人最终位置: {data.body('base').xpos}") | ||
viewer_instance.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
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
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
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
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
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.
如果没有内容,这个文件就不需要添加