gazebosim / gz-common

An audio-visual library supports processing audio and video files, a graphics library can load a variety 3D mesh file formats into a generic in-memory representation, and the core library of Gazebo Common contains functionality that spans Base64 encoding/decoding to thread pools.
https://gazebosim.org
Apache License 2.0
15 stars 39 forks source link

Model with relative path to the mesh not loading when included in another sdf file #236

Open entoture opened 3 years ago

entoture commented 3 years ago

Environment

Description

Steps to reproduce

  1. Create an sdf file with include tag for other sdf
<?xml version="1.0" ?>
<sdf version="1.6">
   <world name="testworld">

      <include>
         <uri>RETAINER.sdf</uri>
         <pose>0 0 0 0 0 0</pose>
      </include>

   </world>
</sdf>
  1. Create an sdf file with included model that use relative path to the mesh
<sdf version="1.6">
      <model name="RETAINER">
         <link name="B001">
            <visual name="visual">
               <geometry>
                  <mesh>
                     <uri>meshes/RETAINER_B001.dae</uri>
                  </mesh>
               </geometry>
            </visual>
         </link>
      </model>
</sdf>
  1. Start ignition gazebo with main sdf file ign gazebo -v 4 main.sdf

Output

Model not loading with errors:

[GUI] [Err] [SystemPaths.cc:467] Could not resolve file [RETAINER.sdf/meshes/RETAINER_B001.dae]
[GUI] [Err] [MeshManager.cc:172] Unable to find file[RETAINER.sdf/meshes/RETAINER_B001.dae]
[GUI] [Err] [MeshDescriptor.cc:56] Mesh manager can't find mesh named [RETAINER.sdf/meshes/RETAINER_B001.dae]
[GUI] [Err] [Ogre2MeshFactory.cc:524] Cannot load null mesh [RETAINER.sdf/meshes/RETAINER_B001.dae]
[GUI] [Err] [Ogre2MeshFactory.cc:103] Failed to get Ogre item for [RETAINER.sdf/meshes/RETAINER_B001.dae]
[GUI] [Err] [SceneManager.cc:373] Failed to load geometry for visual: visual

From the log it seems that included model uri is added to the path which fails path resolving for the mesh. The same model in the main sdf file is working fine. Here is files to reproduce an error: example.zip

chetan-parihar commented 2 months ago

i am also having same problem