Object occlusion issues with camera plugin for ROS
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,
The door appears behind the wall in the camera image, even though it is clearly in front of it in the environment view.
However if I use the "Brick Box 3x1x3" from the model library instead of my own wall model, images are generated correctly:
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
}
}
}
}
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.
Can you try gazebo7?
im working with ros jade so the recommended version is 5.x. I havent tried updating it.