RViz doesn't load .dae mesh. Cannot locate it.

  • 问题描述

I am trying to load an underwater robot mesh in RViz. Because I could not do this with a .osg file, I converted it to .dae with Blender. Even though I have done that, RViz is still not able to load it (it doesn't even locate it although, of course, the file is there).

The file is called newestexport.dae. I show the .URDF file that calls the mesh:

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="nessie" >
  <xacro:property name="pi" value="3.141592654" />

<link name="base_link">
      <origin rpy="3.141592654 0 3.141592654" xyz="0 0 0"/>
</link>

<joint name="base_link_to_nessie_base_link" type="fixed">
    <parent link="base_link"/>
    <child link="nessie_base_link"/>
</joint>

  <link name="nessie_base_link">
    <inertial>
      <mass value="95" />
      <inertia ixx="100"  ixy="0"  ixz="0" iyy="100" iyz="0" izz="100" />
    </inertial>
    <visual>
      <origin rpy="-${pi/2} 0 ${pi}" xyz="-0.2 0 0.75"/>
      <geometry>
        <mesh filename="robot/nessie/newestexport.dae"/>
      </geometry>
    </visual>
  </link>

</robot>

The error is the following:

[ERROR] [1518623879.761036843]: Could not load resource [robot/nessie/newestexport.dae]: Unable to open file "robot/nessie/newestexport.dae". [ERROR] [1518623879.761668482]: Could not load model 'robot/nessie/newestexport.dae' for link 'nessie_base_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource robot/nessie/newestexport.dae in resource group Autodetect or any other group. in ResourceGroupManager::openResource at /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreResourceGroupManager.cpp (line 756)

Also, Meshlab and Blender are able to open the mesh without any problem.

The name of the file is correct. So that is discarded.

UPDATE: If you change the path "robot/nessie/newestexport.dae" for ithe absolute path "/home/daniel/.uwsim/data/robot/nessie/newestexport.dae" it doesn't work, the error still appears. Nor if you put it in the /home/daniel folder.

  • 解决办法

改成<mesh filename="file:///robot/nessie/newestexport.dae"/>

  • 最终结论

This syntax worked better for me "file:///$(find package_name)/path/to/file". This will likely work for different machines

参考网页

  1. https://answers.ros.org/question/39116/bug-mesh-file-path-in-urdf-cannot-locate-resource-file/
  2. https://answers.ros.org/question/282745/rviz-doesnt-load-dae-mesh-cannot-locate-it/
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

abcwoabcwo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值