STL file fails to load when using user-created package
I'm trying to load an STL file in xacro and find that it works fine when I place the file in 'urdf_tutorial/meshes'. However, if I try to reference the same file, but now in a sub-directory of my own package, then it seems to fail silently (STL file just fails to appear when visualized in rviz).
So this works:
<link name="base_footprint">
<visual>
<geometry>
<mesh filename="package://urdf_tutorial/meshes/mini.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="gray"/>
<origin rpy="0.0 0.0 1.57" xyz="0.075 -0.075 0.0"/>
</visual>
</link>
But this does not:
<link name="base_footprint">
<visual>
<geometry>
<mesh filename="package://scanner2d/launch/mini.stl" scale="0.001 0.001 0.001"/>
</geometry>
<material name="gray"/>
<origin rpy="0.0 0.0 1.57" xyz="0.075 -0.075 0.0"/>
</visual>
</link>
Everything else about the 'scanner2d' package works fine (eg. I can run 'rosrun scanner2d scanner2d'). I've triple-checked paths, names, etc. And I have done 'source devel/setup.bash' in the catkin_ws.
Why does the 'package' filename fail with my own package?
Rhoeby Mini-Turty, Raspberry Pi 3B, Ubuntu 16.04, Kinetic
Is mini.stl in the launch sub-directory within your scanner2d package?
Are you running rviz on your raspberry pi, or on a different computer? The mesh files have to be on the computer where rviz is running, even if your ROS core is running elsewhere.
Yes, in the launch sub-directory. In the testing I'm doing, both rviz and the mini.stl are on the same computer (it's basically "off-robot" work). It's a good point though. The lack of distributed support for this feature is a problem, just not the issue I'm facing right now.
I was going to say check the units on
mini.stl
just to make sure the second is not in mms (and then getting scaled to um), but if it's the same file, then that should not be the case here.If meshes can't be found, RViz (or really: Ogre) will scream at you, so if you're not seeing an error ..
.. of that sort, the mesh is most likely found and loaded (try changing the filename of the mesh referenced, just to see the error). It could be that something else is making it not display.
Yup. I tried using a .dae file from turtlebot. Same problem. So it's not the content of the file. Anyway, ahendrix point about the lack of distributed support means this feature is not very useful (at least in my particular context).