You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Gazebo Garden加载动画盒子SDF文件时遇Mesh报错求助

解决Gazebo Garden加载旧版本动画SDF的错误

错误根源

你用的是Gazebo Garden,但参考的是Gazebo Classic(gazebo9)的教程SDF文件,两者的Actor动画定义语法完全不兼容,导致Mesh管理器无法识别旧格式的路径,抛出Invalid mesh filename extension和Actor skin mesh not found错误——这和你在Blender里加骨骼没有关系。

修复步骤

  1. 替换为Garden兼容的SDF结构
    把原animated_box.world里的Actor部分换成以下代码(以简单盒子骨骼动画为例):
    <actor name="animated_box">
      <pose>0 0 0.5 0 0 0</pose>
      <skin>
        <filename>model://animated_box/meshes/box_animated.dae</filename>
        <scale>1.0</scale>
      </skin>
      <animation name="walk">
        <filename>model://animated_box/meshes/box_animated.dae</filename>
        <scale>1.0</scale>
        <interpolate_x>true</interpolate_x>
      </animation>
      <script>
        <loop>true</loop>
        <delay_start>0.0</delay_start>
        <animation name="walk" />
      </script>
    </actor>
    
  2. 规范模型文件结构
    确保模型文件夹按Gazebo标准结构存放:
    ~/.gazebo/models/animated_box/
    ├── model.sdf
    └── meshes/
        └── box_animated.dae  # 带骨骼动画的Blender导出文件
    
    导出Blender模型时注意:
    • 选择Collada (.dae)格式
    • 勾选Armature和Mesh选项
    • 文件路径不要包含中文或特殊字符
  3. 测试运行
    在终端执行命令启动仿真:
    gz sim animated_box.world
    

额外提示

  • 直接在终端运行gz sim actor.sdf,就能查看Gazebo Garden官方提供的Actor动画示例,参考标准结构
  • 绝对不要混用不同Gazebo版本的SDF文件,Classic和Garden的语法差异极大

内容的提问来源于stack exchange,提问作者Ja_cpp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 16:55:00