Home | Tutorials | Wiki | Issues
Ask Your Question
0

Object occlusion issues with camera plugin for ROS

asked 2015-10-23 00:51:39 -0600

I created two simple SDF models to represent a wall section and a door prop (that is, just a board with the picture of a door on it). When I place a "door" in front of a wall and get a camera (via the ROS camera plugin) to record the scene,

image description

The door appears behind the wall in the camera image, even though it is clearly in front of it in the environment view.

image description

However if I use the "Brick Box 3x1x3" from the model library instead of my own wall model, images are generated correctly:

image description

image description

What could be the problem here?

The wall SDF model and texture script are:

yumebros_room_wall_240cm2.sdf

<?xml version='1.0'?>
<sdf version="1.4">
  <model name='yumebros_room_wall_240cm2'>
    <static>true</static>
    <link name='link'>
      <pose>0 0 1.2 0 0 0</pose>
      <collision name='collision'>
        <geometry>
          <box>
            <size>0.2 2.4 2.4</size>
          </box>
        </geometry>
      </collision>
      <visual name='visual'>
        <geometry>
          <box>
            <size>0.2 2.4 2.4</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>model://yumebros_room_wall_240cm2/materials/scripts</uri>
            <uri>model://yumebros_room_wall_240cm2/materials/textures</uri>
            <name>Yumebros/RoomWallSurface</name>
          </script>
        </material>
      </visual>
    </link>
  </model>
</sdf>

white_paint.material

material Yumebros/RoomWallSurface
{
  technique
  {
    pass
    {
      texture_unit
      {
        texture white_paint.png
        scale 0.125 0.125
      }
    }
  }
}

And for the door:

yumebros_door_blue.sdf

<?xml version='1.0'?>
<sdf version="1.4">
  <model name='yumebros_door_blue'>
    <pose>0 0 1.05 0 0 0</pose>
    <static>1</static>
    <link name='link'>
      <collision name='collision'>
        <geometry>
          <box>
            <size>0.05 0.92 2.1</size>
          </box>
        </geometry>
      </collision>
      <visual name='visual'>
        <geometry>
          <box>
            <size>0.05 0.92 2.1</size>
          </box>
        </geometry>
        <material>
          <script>
            <uri>model://yumebros_door_blue/materials/scripts</uri>
            <uri>model://yumebros_door_blue/materials/textures</uri>
            <name>Yumebros/DoorBlue</name>
          </script>
        </material>
      </visual>
      <self_collide>1</self_collide>
      <gravity>1</gravity>
    </link>
  </model>
</sdf>

door_blue.material

material Yumebros/DoorBlue
{
  technique
  {
    pass
    {
      texture_unit
      {
        texture door_blue.png
      }
    }
  }
}
edit retag flag offensive close merge delete

Comments

Im having the same problem with gazebo 5.3 on ubuntu. The background wall appears in front of the object when looking through a gazebo camera object. In my case it is with both textured and untextured walls. The same world setting had no problem with gazebo 5.1.

kke gravatar imagekke ( 2016-07-25 15:01:28 -0600 )edit

Can you try gazebo7?

nkoenig gravatar imagenkoenig ( 2016-07-26 08:51:42 -0600 )edit

im working with ros jade so the recommended version is 5.x. I havent tried updating it.

kke gravatar imagekke ( 2016-07-27 03:44:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-26 21:55:26 -0600

Turns out this is a known issue in Gazebo. Apparently it is related to specific graphic card driver issues. Currently the only possible solution is to recompile Gazebo with a changed parameter; see Xander Dunn's answer for details.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-10-23 00:51:39 -0600

Seen: 705 times

Last updated: Aug 26 '16