Meshes Not Displaying in RViz or Gazebo
I have a xacro file that I'm using in a launch file containing the links and joints for a car; roslaunch racecar-gazebo racecar_gazebo.launch
runs successfully, as I get this: [spawn_car-3] process has finished cleanly
, with no errors from gzserver, but the model meshes do not appear in gazebo or rviz. RViz does give me the OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource
error when trying to load the robot model.
For all links except for spherical hinges I have between the chassis & wheels, I have meshes for displaying their visual (the spherical hinges are the only links that display in either program). Each link also contains a collision element. These meshes are pointed to in the xacro file like this: <mesh filename="$(find racecar_description)/meshes/left_front_wheel.dae" />
. I'm not using <uri> or other tags as shown in the tutorials, as it appears any <mesh> tag requires a filename attribute now.
The usual things to check for:
1.) output of ls -la .../racecar_description/meshes
:
-rw-r--r-- 1 bfoster domain users 1085739 Oct 18 19:39 chassis.dae
-rw-r--r-- 1 bfoster domain users 87855 Oct 9 17:41 hokuyo.dae
-rw-r--r-- 1 bfoster domain users 151374 Oct 9 17:41 left_front_wheel.dae
-rw-r--r-- 1 bfoster domain users 151654 Oct 9 17:41 left_rear_wheel.dae
-rw-r--r-- 1 bfoster domain users 154883 Oct 9 17:41 right_front_wheel.dae
-rw-r--r-- 1 bfoster domain users 154752 Oct 9 17:41 right_rear_wheel.dae
All files in my xacro code are all declared with lower-case
2.) output of rospack find racecar_description
: ... src/racecar_description
3.) I even ran ls --absolute path-- | grep right_rear_wheel.dae
by copying and pasting from the error message, so there's not a typo in the code.
4.) the whole xacro tag enclosing each mesh tag reads like this:
<xacro:macro name="right_rear_wheel_geometry">
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="$(find racecar_description)/meshes/right_rear_wheel.dae" />
</geometry>
</xacro:macro>
Edit:
I changed the filename from $(find racecar_decription)
to package://racecar_description...
and that did the trick for rviz. Gazebo still isn't reading it.
So your model is visble in rviz but not in gazebo! Do you still recieve any errors after the change?
That is correct. For clarification, I am aiming to have this display in gzweb, since I'm connecting to the host machine through ssh. But can run the desktop application through ssh (three cheers for upgrading to melodic & not having to use gazebo 7!), and the meshes still do not load. I can load the collision geometries, which I've just minimized to boxes, cylinders, and the non-mesh shapes.
Maybe your problem lies within the DAE files. Can you check and tell me whether transparent opaque tag is set to "RGB-Zero" in your .dae file?
it looks like that tag isn't set at all. I do see it set in a model I downloaded from the db; these were custom ones created in blender & exported.
Do you have the model in github or something? Can you share the link if that's the case?
No, it's on an internal gitlab repo. After hours of comparing my dae file to others that will display, I remembered the browser developer tools (trying in gzweb, since gazebo over ssh still crashes immediately). Lots of 404s. So gzserver finds the meshes, but the web application expects to find the models in its model db at http/client/assets, & the files aren't there. It looks like I need to manually copy the meshes there, since there's no feature in gzweb like there is in desktop gazebo that allows the user to extend the model db.