URI for meshes not working in Fortress?
So, I'm trying to spawn a model in a running Ignition Fortress world (any will do, it doesn't change anything), through ROS2 Humble.
The model I'm using is this one, which as you can see uses <uri>model://X3/meshes/led.dae</uri>
to load meshes and other stuff from the same folder in which model.sdf
is located.
The overall relevant structure is this:
workspace
|- src
|- pkg1
|- description
|- X3
|- meshes_folder
|- model.sdf
|- launch
|- launch_model.py
|- pkg2
|- launch_world.py
Of course both package have the conventional structure and the package.xml
file; they still have only a launch file, but will be cmake_ament packages.
I can start Ignition with no problem, loading the desired world with the launch file from pkg2. I then use another launch file from pkg1 to load the X3 model, which is indeed found and loaded into Ignition but without meshes, as the terminal issues multiple lines like
Unable to find file with URI [model://X3/meshes/x3.dae]
Could not resolve file [model://X3/meshes/x3.dae]
Unable to find file[model://X3/meshes/x3.dae]
Mesh manager can't find mesh named [model://X3/meshes/x3.dae]
Cannot load null mesh [model://X3/meshes/x3.dae]
Failed to get Ogre item for [model://X3/meshes/x3.dae]
Failed to load geometry for visual: base_link_inertia_visual
and so on. I can't seem to understand how to get it working. I've seen multiple posts (like this one) about using
<gazebo_ros gazebo_model_path="${prefix}" />
<gazebo_ros gazebo_media_path="${prefix}" />
(or similar) being sure to also add <exec_depend>gazebo_ros</exec_depend>
to the package.xml
file and to install the directory in the package's share folder, like
install(
DIRECTORY config description launch
DESTINATION share/${PROJECT_NAME}
)
Even though I do this, I can't get it working.
Anyone has any suggestion?