-
Notifications
You must be signed in to change notification settings - Fork 319
多目标点巡逻功能,恢复main.py #3262
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
多目标点巡逻功能,恢复main.py #3262
Changes from all commits
Commits
Show all changes
80 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 037a142
Merge branch 'OpenHUTB:main' into main
mengdeqi12 6593f90
Merge branch 'OpenHUTB:main' into main
mengdeqi12 56b0b9a
Merge branch 'OpenHUTB:main' into main
mengdeqi12 7b83d1f
Merge branch 'OpenHUTB:main' into main
mengdeqi12 8f12c9b
在模型文件中添加腿部模型,更新运行脚本
mengdeqi12 6824f42
Merge branch 'OpenHUTB:main' into main
mengdeqi12 ad97f14
Merge branch 'OpenHUTB:main' into main
mengdeqi12 0ff1f2c
Merge branch 'OpenHUTB:main' into main
mengdeqi12 c20f8cc
Merge branch 'OpenHUTB:main' into main
mengdeqi12 319d3ab
Merge branch 'OpenHUTB:main' into main
mengdeqi12 e5251c7
Merge branch 'OpenHUTB:main' into main
mengdeqi12 fc99023
增加模型文件内容
mengdeqi12 461a961
Merge branch 'OpenHUTB:main' into main
mengdeqi12 affa266
Merge branch 'OpenHUTB:main' into main
mengdeqi12 299d247
纠正了初始姿态失衡 和 关节限位 / 惯性参数不匹配的问题
mengdeqi12 2940fa3
Merge branch 'OpenHUTB:main' into main
mengdeqi12 c82c80c
Merge branch 'OpenHUTB:main' into main
mengdeqi12 de55c15
Merge branch 'OpenHUTB:main' into main
mengdeqi12 4967733
Merge branch 'OpenHUTB:main' into main
mengdeqi12 b41e691
优化模型
mengdeqi12 ecd7d05
优化模型
mengdeqi12 045475f
添加 .gitignore 文件
mengdeqi12 129142f
优化模型文件,并更新.gitignore
mengdeqi12 3c4365e
Merge branch 'OpenHUTB:main' into main
mengdeqi12 132d0c5
Merge branch 'OpenHUTB:main' into main
mengdeqi12 a503d33
Merge branch 'OpenHUTB:main' into main
mengdeqi12 d50e4e8
增加了障碍模型
mengdeqi12 d5ae6bd
Merge branch 'OpenHUTB:main' into main
mengdeqi12 824fce6
Merge branch 'OpenHUTB:main' into main
mengdeqi12 ade3208
采用mujoco开源模型优化原有模型
mengdeqi12 5bdaab9
新增忽略Python缓存文件规则
mengdeqi12 8d4501e
采用mujoco开源模型优化原有模型
mengdeqi12 0376896
Merge branch 'OpenHUTB:main' into main
mengdeqi12 6644c82
Merge branch 'OpenHUTB:main' into main
mengdeqi12 0b8a0a5
简化障碍模型,优化机器人避障机制
mengdeqi12 e2c33ea
Merge branch 'OpenHUTB:main' into main
mengdeqi12 ed4c9f2
增加了障碍模型
mengdeqi12 df216d9
Merge branch 'OpenHUTB:main' into main
mengdeqi12 42935b9
为wall2添加slide关节,使其可沿 Y 轴(左右)或 X 轴(前后)动态移动,保留wall1为固定障碍作为基础避障目标
mengdeqi12 ec2e2be
Merge branch 'OpenHUTB:main' into main
mengdeqi12 fb4c979
增加固定点目标导航模块
mengdeqi12 9189840
Merge branch 'OpenHUTB:main' into main
mengdeqi12 49027d4
复杂动态环境中完成目标导航
mengdeqi12 84f13e7
Merge branch 'OpenHUTB:main' into main
mengdeqi12 7723d52
在动态避障中实现了多个固定目标点的导航
mengdeqi12 6e3e02a
停止跟踪MUJOCO_LOG.TXT日志文件,加入.gitignore忽略
mengdeqi12 8f2b671
在动态避障中实现了多个固定目标点的导航
mengdeqi12 4a5adbf
在动态避障中实现了多个固定目标点的导航
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
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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| # 核心库(必须安装) | ||
| mujoco==3.3.6 | ||
| numpy==2.2.6 | ||
| python==3.12 | ||
|
|
||
| # 间接依赖(通常自动安装,若缺失则补充) | ||
| absl-py==2.3.1 | ||
|
|
||
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,84 +0,0 @@ | ||
| 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() | ||
|
|
||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 日志不需要添加 |
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| Mon Dec 15 09:31:10 2025 | ||
| WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.8450. | ||
|
|
||
| Mon Dec 15 09:31:11 2025 | ||
| WARNING: Nan, Inf or huge value in QACC at DOF 15. The simulation is unstable. Time = 0.2150. | ||
|
|
||
| Mon Dec 15 09:31:24 2025 | ||
| WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 5.2000. | ||
|
|
||
| Mon Dec 15 09:31:25 2025 | ||
| WARNING: Nan, Inf or huge value in QACC at DOF 6. The simulation is unstable. Time = 0.1700. | ||
|
|
||
| Mon Dec 15 10:46:22 2025 | ||
| WARNING: Nan, Inf or huge value in QVEL at DOF 17. The simulation is unstable. Time = 0.5050. | ||
|
|
||
| Mon Dec 15 10:46:23 2025 | ||
| WARNING: Nan, Inf or huge value in QPOS at DOF 6. The simulation is unstable. Time = 0.1400. | ||
|
|
||
| Mon Dec 15 13:22:44 2025 | ||
| WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.7500. | ||
|
|
||
| Mon Dec 15 13:23:19 2025 | ||
| WARNING: Nan, Inf or huge value in QACC at DOF 6. The simulation is unstable. Time = 0.9500. | ||
|
|
||
| Mon Dec 15 13:23:23 2025 | ||
| WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.9750. | ||
|
|
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.
删除后,没有入口脚本