Home | Tutorials | Wiki | Issues
Ask Your Question
0

Background color error when using multiple cameras

asked 2013-12-11 12:54:48 -0500

altrouge gravatar image

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 ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-18 03:56:05 -0500

altrouge gravatar image

It seems it was due to the fact my cameras used noise. I used the model described in the tutorial,

<camera>
  <horizontal_fov>1.047</horizontal_fov>
  <image>
    <width>1024</width>
    <height>1024</height>
  </image>
  <clip>
    <near>0.1</near>
    <far>100</far>
  </clip>
  <noise>
    <type>gaussian</type>
    <mean>0.0</mean>
    <stddev>0.007</stddev>
  </noise>
</camera>

Without this noise, I don't have the background color error anymore. I don't really know if it was specific to my platform.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-12-11 12:54:48 -0500

Seen: 288 times

Last updated: Dec 18 '13