STL file fails to load when using user-created package

asked 2019-02-12 20:02:26 -0500

tfurgerson gravatar image

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

edit retag flag offensive close merge delete

Comments

Is mini.stl in the launch sub-directory within your scanner2d package?

ahendrix gravatar image ahendrix  ( 2019-02-12 22:07:43 -0500 )edit

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.

ahendrix gravatar image ahendrix  ( 2019-02-12 22:09:16 -0500 )edit

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.

tfurgerson gravatar image tfurgerson  ( 2019-02-12 23:57:44 -0500 )edit

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 ..

gvdhoorn gravatar image gvdhoorn  ( 2019-02-13 01:44:42 -0500 )edit

.. 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.

gvdhoorn gravatar image gvdhoorn  ( 2019-02-13 01:45:49 -0500 )edit

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).

tfurgerson gravatar image tfurgerson  ( 2019-02-13 08:28:56 -0500 )edit