Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Background color error when using multiple cameras

Hello,

I put a black ambient/background to the scene of a world during a simulation, and I observe it with a model containing multiple cameras. The first camera included in the model will get the normal image as background, but the second onwards get a luminous one (or, when using plugins, it seems it is the first camera that actually produces an image that gets the good background).

Here is the model world used:

<?xml version ='1.0'?>
<sdf version ='1.4'>
  <world name='default'>
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://sun</uri>
    </include>

    <include>
      <uri>model://hopping</uri>
    </include>

    <scene>
      <ambient>0 0 0 1</ambient>
      <background>0 0 0 1</background>
    </scene>
</world>
</sdf>

with hopping containing identical camera sensors (just with a name change):

<include>
  <uri>model://noisy_cam2</uri>
  <name>camera2</name>
  <pose>-0.05 -0.05 0.05 0 -0.785 -2.08</pose>
</include>
<joint name="camera_joint2" type="revolute">
  <child>camera2::link</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <upper>0</upper>
      <lower>0</lower>
    </limit>
  </axis>
</joint>
<include>
  <uri>model://noisy_cam1</uri>
  <name>camera1</name>
  <pose>0.05 0.0 0.0 0 0 0</pose>
</include>
<joint name="camera_joint" type="revolute">
  <child>camera1::link</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <upper>0</upper>
      <lower>0</lower>
    </limit>
  </axis>
</joint>

With gztopic view /gazebo/.../image, for instance, by changing the views, there are not the same (sorry, my karma is way too low for uploading images, so here are screenshots uploaded to imgur)

camera2 (normal black background)

camera1 (way too gray, background not black)

Other than this wrong background, the images are fine, if someone has any idea ?