-
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
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
This comment was marked as resolved.
This comment was marked as resolved.
tatus
Outdated
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.
这个文件是git日志文件,需要删除
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.
OK
同时修改了三个模块中的内容,需要其他模块开发同学同意 |
根目录下的tatus还未删除 |
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.
如果没有内容,这个文件就不需要添加
No description provided.