Gazebo Answers logo


I created a simple rock model, the visual is a .dae file and the collision is a simple box of roughly the same size. I then add multiple clones of the rock randomly distributed on the floor of my gazebo world (at the end of the world described in test2.sdf) I have a robot equipped with the Gazebo camera plugin. If I look inside the gazebo client gui, the rocks appear along all the other elements, and with the camera previzualization activated, it seems the camera sees everything (screenshot 1). But when I open for example rqt_image_view to check out the feed from the camera topic, then my rocks disappear (screenshot 2)! All the other elements are still viewed... Any idea why? And more importantly, any ideas how to fix this? I would like my robot to be able to see the rocks, for it to be able to avoid them, pick them up, etc.

Screenshot 1


Screenshot 2


Here are the files of my model


<?xml version="1.0"?>

  <sdf version="1.5">model.sdf</sdf>

    <name>Louis M</name>

    A Rock.


<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="unit_box_1">
    <link name="link">
        <pose>-0.01 -0.012 0.15 0 0 0</pose>
      <collision name="collision">
        <pose>0 0 -0.46 0 0 0</pose>
            <size>0.05 0.05 0.2</size>
              <fdir1>0 0 0</fdir1>
      <visual name="visual">
        <pose>0 0 -0.46 0 0 0</pose>


<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
            <authoring_tool>VCGLib | MeshLab</authoring_tool>
        <created>Wed Apr 25 01:36:10 2012</created>
        <modified>Wed Apr 25 01:36:10 2012</modified>
        <unit meter="0.00254" name="inches"/>
        <image id="texture0" name="texture0">
        <material id="material0" name="material0">
            <instance_effect url="#material0-fx"/>
        <effect id="material0-fx">
                <newparam sid="texture0-surface">
                    <surface type="2D">
                <newparam sid="texture0-sampler">
                <technique sid="common">
                            <color>0 0 0 1</color>
                            <color>1 1 1 1</color>
                            <texture texture="texture0" texcoord="UVSET0"/>
                            <color>0.2 0.2 0.2 1</color>
                            <color>0 0 0 1</color>
                            <color>0 0 0 1</color>
        <geometry id="shape0-lib" name="shape0">
                <source id="shape0-lib-positions" name="position">
                    <float_array id="shape0-lib-positions-array" count="7686">-31.52  a lot of numbers 183.9</float_array>
                        <accessor count="2562" source="#shape0-lib-positions-array" stride="3">
                            <param name="X" type="float"/>
                            <param name="Y" type="float"/>
                            <param name="Z" type="float"/>
                <source id="shape0-lib-normals" name="normal">
                    <float_array id="shape0-lib-normals-array" count="15360">0.671913 another lot of numbers -0.958825</float_array>
                        <accessor count="5120" source="#shape0-lib-normals-array" stride="3">
                            <param name="X" type="float"/>
                            <param name="Y" type="float"/>
                            <param name="Z" type="float"/>
                <source id="shape0-lib-map" name="map">
                    <float_array id="shape0-lib-map-array" count="30720">0.01326 another big lot of numbers 0.5587</float_array>
                        <accessor count="15360" source="#shape0-lib-map-array" stride="2">
                            <param name="U" type="float"/>
                            <param name="V" type="float"/>
                <vertices id="shape0-lib-vertices">
                    <input semantic="POSITION" source="#shape0-lib-positions"/>
                <triangles count="5120" material="material0">
                    <input offset="0" semantic="VERTEX" source="#shape0-lib-vertices"/>
                    <input offset="1" semantic="NORMAL" source="#shape0-lib-normals"/>
                    <input offset="2" semantic="TEXCOORD" source="#shape0-lib-map"/>
                    <p>151 more numbers 15359</p>
        <visual_scene id="VisualSceneNode" name="VisualScene">
            <node id="node" name="node">
                <instance_geometry url="#shape0-lib">
                            <instance_material symbol="material0" target="#material0">
                                <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD"/>
        <instance_visual_scene url="#VisualSceneNode"/>

and here are my launch and world files


<?xml version="1.0"?>

  <arg name="kinect_enabled" default="false"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find my_robot_gazebo)/worlds/test2.sdf"/>
    <arg name="paused" value="true"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>

  <include file="$(find my_robot_gazebo)/launch/spawn_my_robot.launch">
    <arg name="kinect_enabled" value="$(arg kinect_enabled)"/>

test2.sdf (world)

This code block was moved to the following github gist: https://gist.github.com/answers-se-migration-openrobotics/63d34c457cd990c4f81e0319fecd4031

Thank you very much for any input on how to get my camera to see those rocks!

For info I am using Gazebo 9 with ROS Kinetic

Originally posted by kinglm on Gazebo Answers with karma: 1 on 2018-08-15

Post score: 0


1 Answer 1


Gazebo Answers logo

The solution that worked for me was putting the model description directly inside the world .sdf file. Under the tag, instead of I have which contains the entire description (the same one that was in the model.sdf file).

So no more model.config or model.sdf. The collada (.dae) mesh file is still in a separate folder though.

I don't know what the reason behind this is, and it bloats the world file, but at least now my camera output topic contains the rocks!


Originally posted by kinglm with karma: 1 on 2018-10-10

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by m.bahno on 2020-09-18:
My guess would be that GAZEBO_MODEL_PATH is not set correctly for rqt_image_view and thus the models are not loaded. I had similar problem when trying to run Gazebo client on another machine.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.