Repository navigation
覆盖上次提交(修复乱码),增加动态目标巡航的功能 - #3737
Closed
mengdeqi12 wants to merge 94 commits into
Closed
mengdeqi12 wants to merge 94 commits into
mengdeqi12 wants to merge 94 commits into
Conversation
1. 核心修改:在 main.py 头部新增自动切换工作目录逻辑 - 通过 os.path 获取脚本绝对路径,计算并切换到项目根目录(D:\pycharm\nn2) - 统一相对路径基准,避免因运行目录不同导致的路径错误 2. 增强鲁棒性: - 新增模型路径存在性检查,提前捕获「文件不存在」错误并给出明确提示 - 路径使用正斜杠(/)替代反斜杠(\),保证 Windows/macOS/Linux 跨平台兼容性 - 打印日志增加 [INFO]/[SUCCESS]/[ERROR] 前缀,便于调试定位问题 3. 解决的核心问题: - 原版代码因相对路径基准不统一,频繁出现「No such file or directory」错误 - 无需手动修改模型路径,支持从任意目录运行 main.py 仍能正常加载 humanoid.xml 修改文件:src/humanoid_motion_control/main.py
1. 核心修改:在 main.py 头部新增自动切换工作目录逻辑 - 通过 os.path 获取脚本绝对路径,计算并切换到项目根目录(D:\pycharm\nn2) - 统一相对路径基准,避免因运行目录不同导致的路径错误 2. 增强鲁棒性: - 新增模型路径存在性检查,提前捕获「文件不存在」错误并给出明确提示 - 路径使用正斜杠(/)替代反斜杠(\),保证 Windows/macOS/Linux 跨平台兼容性 - 打印日志增加 [INFO]/[SUCCESS]/[ERROR] 前缀,便于调试定位问题 3. 解决的核心问题: - 原版代码因相对路径基准不统一,频繁出现「No such file or directory」错误 - 无需手动修改模型路径,支持从任意目录运行 main.py 仍能正常加载 humanoid.xml 修改文件:src/humanoid_motion_control/main.py
1. 核心修改:在 main.py 头部新增自动切换工作目录逻辑 - 通过 os.path 获取脚本绝对路径,计算并切换到项目根目录(D:\pycharm\nn2) - 统一相对路径基准,避免因运行目录不同导致的路径错误 2. 增强鲁棒性: - 新增模型路径存在性检查,提前捕获「文件不存在」错误并给出明确提示 - 路径使用正斜杠(/)替代反斜杠(\),保证 Windows/macOS/Linux 跨平台兼容性 - 打印日志增加 [INFO]/[SUCCESS]/[ERROR] 前缀,便于调试定位问题 3. 解决的核心问题: - 原版代码因相对路径基准不统一,频繁出现「No such file or directory」错误 - 无需手动修改模型路径,支持从任意目录运行 main.py 仍能正常加载 humanoid.xml 修改文件:src/humanoid_motion_control/main.py
Member
|
有冲突 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
修改概述:
修改的详细描述
巡逻点结构重构
为每个巡逻点新增 _base 父体,用于挂载滑动关节
每个巡逻点添加 slide_x/slide_y 滑动关节(X/Y 轴移动)
关节添加阻尼(damping="0.5"),确保移动平滑无抖动
2. 动态控制执行器
新增 patrolX_motor_x/patrolX_motor_y 执行器,用于控制巡逻点移动
合理设置控制范围(ctrlrange):X 轴 -2.0
14.0,Y 轴 -5.05.0齿轮比(gear=5.0)适配低速平滑移动
3. 碰撞优化
新增机器人与巡逻点的碰撞配置,设置极低摩擦系数,避免目标点影响机器人运动
保留原有障碍物碰撞逻辑,不影响避障功能
经过了什么样的测试?
运行效果
动图、视频、截图等
加载不出mujoco的可视化窗口,只有输出台有输出
2025-12-18.203138.mp4