0
$\begingroup$

Rosanswers logo

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.

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.

Any thoughts?

EDIT: 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>

Thank you.

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.


Originally posted by thepirate16 on ROS Answers with karma: 101 on 2018-02-14

Post score: 2


Original comments

Comment by gvdhoorn on 2018-02-14:
Are you sure the URDF matches with the error message?

I ask because the error message mentions robot/nessie/newestexport.dae, while the URDF has /home/daniel/.uwsim/data/robot/nessie/newestexport.dae. That is a different path.

Comment by thepirate16 on 2018-02-14:
@gvdhoorn Sorry. I posted the wrong file. I update it now.

$\endgroup$

1 Answer 1

1
$\begingroup$

Rosanswers logo

<mesh filename="robot/nessie/newestexport.dae"/>

This is not an absolute path, so I believe rviz would try to load that mesh relative to its working directory, which is probably $HOME/.ros (ie: $ROS_HOME, see roslaunch/XML/node). Concatenating those would give: $HOME/.ros/robot/nessie/newestexport.dae.

Can you try specifying either:

  • an absolute path to the file
  • or place it in a ROS pkg and use $(find PKG_NAME)/path/to/file/in/package

Edit:

I tried to put the file in /home/daniel/ but it is not working either. Could not load resource [/home/daniel/newestexport.dae]: Unable to open file "/home/daniel/newestexport.dae".. Same error

as @Javier Perez mentions, RViz uses resource_retriever to load meshes.

That package accepts any URL, so an absolute path on the local filesystem should be prefixed with file://. In your case it would be file:///home/daniel/newestexport.dae (the three forward slashes are required).

But note that this will probably make UWSim unhappy.


Originally posted by gvdhoorn with karma: 86574 on 2018-02-14

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by thepirate16 on 2018-02-14:
@gvdhoorn I did put the absolute path, and the error still appears. I guess the path is not a problem as one folder is an autogenerated folder of UWSim. Like a direct dependency.

Comment by Javier Perez on 2018-02-14:
I guess the misunderstanding comes from the fact that UWSim uses URDF files assuming the meshes are inside its autogenerated folder. However this makes this files not loadable by rviz. SO it is a matter of choosing the right path.

Comment by gvdhoorn on 2018-02-14:\

I did put the absolute path, and the error still appears

with an absolute path RViz can still not load the file? That seems strange.

Comment by gvdhoorn on 2018-02-14:
@Javier Perez: if this is UWSim specific behaviour, then perhaps you should post your comment as an answer?

Comment by thepirate16 on 2018-02-14:
@Javier Perez what do you mean with "not loadable"? .uwsim is a hidden folder, a part from that if the absolute path is given the file should be found.

Comment by Javier Perez on 2018-02-14:
UWSim expects to find a relative path from ~/.uwsim, while rviz expects a "package://XXX" or "file://XXX" prefix so the same .urdf will not load on both systems if I'm not wrong, It has been some months without working on this.

Comment by gvdhoorn on 2018-02-14:
It's not too nice, but perhaps a symlink linking the mesh in a package to a subdir in the .uwsim dir could work.

Comment by Javier Perez on 2018-02-14:
Sorry for double posting, but I think rviz uses a resource retriever: http://wiki.ros.org/resource_retriever have a look at the syntax and everything should be fine :)

Comment by thepirate16 on 2018-02-14:
@gvdhoorn @Javier Perez the fact is that I am not using the same mesh file for UWSim and RViz. I am using an .osg mesh for UWSim, but need to use a .dae mesh for RViz. The only similitude here is that the meshes, once opened, are the same. I think the problem is just RViz not locating the mesh file.

Comment by thepirate16 on 2018-02-14:
I tried to put the file in /home/daniel/ but it is not working either. Could not load resource [/home/daniel/newestexport.dae]: Unable to open file "/home/daniel/newestexport.dae".. Same error.

Comment by gvdhoorn on 2018-02-14:
According to @Javier Perez, UWSim has its own search path for meshes (ie: $HOME/.uwsim). It won't consider any other paths.

RViz will happily look in any directory though. So I'd make sure the mesh can be found by UWSim, and then use a symlink or other to get the mesh on RViz search path.

Comment by thepirate16 on 2018-02-14:
@gvdhoorn UWSim is finding perfectly the mesh and simulating it. It's RViz who is not.

Comment by thepirate16 on 2018-02-14:
OKAY! Using file:///home/daniel/newestexport.dae did the job. UWSim does not complain. :-) Thank you @gvdhoorn and @Javier Perez. You guys rock.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.