Skip to content
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

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

Open
entoture opened this issue Aug 4, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@entoture
Copy link

entoture commented Aug 4, 2021

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build?
    Source, Ignition Edifice, ign-common commit: ee5ba8e

Description

  • Expected behavior:
    When using include tag to add model from another sdf file, model's mesh loads normally
  • Actual behavior:
    When using include tag to add model from another sdf file, this model is not loading if 1) it has mesh and 2) mesh uri is relative to the file location

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

@entoture entoture added the bug Something isn't working label Aug 4, 2021
@chapulina chapulina self-assigned this Aug 9, 2021
@chetan-parihar
Copy link

i am also having same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants