Gazebo | Ignition | Community
Ask Your Question

Gazebo/RViz : Emulated camera can't display STL imported object in RViz

asked 2022-03-14 11:44:00 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello everyone, I am working on a mobile robot and wanted to simulated it in an environement in Gazebo. When I emulate a camera in gazebo and want to display it in RViz, it only shows certain objects : those that are walls or imported from the gazebo models librarie. All the objects I imported from an stl file with a .sdf (I also tried with types .dae and .obj) do display in gazebo but don't show in the RVIZ display (topic: /3Dcamera/color/image_raw with camera or image displays). Here is the example of the model.sdf that I can display on gazebo but not RViZ: C:\fakepath\model.sdf

Here is the difference in RViz between the box I want displayed and a wheel from a gazebo librarie in front of a wall created with Building Editor in Gazebo: in gazebo: image description

in RViz:

image description In the environnement I load, the lines for this particular box is shown below (it's the same principle for every imported stl object):

<model name='boites_clone_0'>
  <pose>-5.62328 -0.573398 0.4 0 -0 1.3e-05</pose>
  <link name='stl_test_box'>
    <collision name='Wall_4_Collision'>
          <size>0.82 0.85 0.4</size>
    <visual name='Wall_4_Visual'>
      <pose>-0.05 0.1 -0.3 0 -0 0</pose>
          <scale>0.001 0.001 0.001</scale>
      <pose>0 0 0 0 -0 0</pose>

I'm using Gazebo 11.9.0 and ROS Noetic on Ubunto 20.04. The STL models come from a mechanical simulation generated inFreeCad. If anyone of you has an ideas or answers to this issue, i'd be pleased to hear them. Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-03-23 08:55:03 -0500

rialia gravatar image

I was having a similar problem with various models I've downloaded, where they would show up in Gazebo but not in RViz. In my case, I found that Gazebo was not searching in the correct places for the materials and meshes, and found the answer from this post on how to add your model directory to the package.xml file.

I hope this helps!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-03-14 11:44:00 -0500

Seen: 254 times

Last updated: Mar 14 '22