What's the correct way to load mesh files in Gazebo and Rviz?
I want to load a URDF model that uses mesh files into Gazebo and Rviz2. For this I have created a package that I have called "abb" and added a folder "meshes" to store the mesh files. The problem is that I can't load a mesh file named "base_link.stl" in Gazebo or Rviz2 when I use the folloging format in the xacro file:
<mesh filename="package://abb/meshes/base_link.stl"/>
I have checked the file exists in the meshes folder. I don't understand why it doesn't work, because it follows the format package://<packagename>/<path>
that is indicated in http://wiki.ros.org/urdf/XML/link and I have seen in many examples on the web.
However if I use the following line in the xacro file it load the mesh file in Gazebo and Rviz2:
<mesh filename="file://$(find abb)/meshes/base_link.stl"/>
Although I can solve the problem using this way I would like to know why it doesn't work when using "package://". I would be very grateful if someone could tell me what I am doing wrong.
Best regards.
I had the same problem and your work around solved the error. But I will wait for better explanation of the problem