Home | Tutorials | Wiki | Issues
Ask Your Question
0

Kinect depth data is saturated to 1 meter

asked 2013-09-10 04:15:55 -0500

Tirjen gravatar image

updated 2013-09-10 10:55:15 -0500

nkoenig gravatar image

Hello everybody,

I'm using the simulated kinect of gazebo with the gazebo_ros_openni_kinect plugin. It works fine when the kinect is looking at objects that are closer than 1 meter, but when the objects are at a distance bigger than 1 meter the depth value is always 1. It is not depending on the near/far clip set in the urdf of the kinect. I'm using ros groovy and gazebo 1.9, the image is taken from the topic /depth/image_raw, but even rviz shows a semi-flat point cloud (that is, flat when the depth is bigger than 1 meter).

Does anyone know how to fix that problem? Thanks!

EDIT: the rgb image works correctly.

depth/image_raw:

https://www.dropbox.com/s/xlycy5troq7g4v0/depth.jpg

rgb/image_raw:

https://www.dropbox.com/s/y0am9uxv7ivub6b/rgb.jpg

This is how the kinect sensor is defined in the urdf:

  <!-- xtion sensor -->
  <gazebo reference="xtion_link">
    <sensor type="depth" name="xtion_sensor">
      <update_rate>20.0</update_rate>
      <camera>
        <horizontal_fov>1.047</horizontal_fov>
        <image>
          <width>640</width>
          <height>480</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.05</near>
          <far>3</far>
        </clip>
        <noise>
          <type>gaussian</type>
          <!-- Noise is sampled independently per pixel on each frame.  
               That pixel's noise value is added to each of its color
               channels, which at that point lie in the range [0,1]. -->
          <mean>0.0</mean>
          <stddev>0.001</stddev>
        </noise>
      </camera>
      <always_on>1</always_on>
      <visualize>true</visualize>
      <plugin name="Xtion_frame_controller" filename="libgazebo_ros_openni_kinect.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>20.0</updateRate>
        <cameraName>xtion</cameraName>
        <imageTopicName>ir/image_raw</imageTopicName>
        <cameraInfoTopicName>ir/camera_info</cameraInfoTopicName>
        <depthImageTopicName>depth/image_raw</depthImageTopicName>
        <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
        <pointCloudTopicName>depth/points</pointCloudTopicName>
        <frameName>xtion_depth_optical_frame</frameName>
        <pointCloudCutoff>0.05</pointCloudCutoff>
        <distortionK1>0.00000001</distortionK1>
        <distortionK2>0.00000001</distortionK2>
        <distortionK3>0.00000001</distortionK3>
        <distortionT1>0.00000001</distortionT1>
        <distortionT2>0.00000001</distortionT2>
      </plugin>
    </sensor>
  </gazebo>

  <!-- xtion rgb camera -->
  <gazebo reference="xtion_link">
    <sensor type="camera" name="xtion_rgb_camera">
      <update_rate>20.0</update_rate>
      <camera>
        <horizontal_fov>1.047</horizontal_fov>
        <image>
          <width>640</width>
          <height>480</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.05</near>
          <far>3</far>
        </clip>
        <noise>
          <type>gaussian</type>
          <!-- Noise is sampled independently per pixel on each frame.  
               That pixel's noise value is added to each of its color
               channels, which at that point lie in the range [0,1]. -->
          <mean>0.0</mean>
          <stddev>0.001</stddev>
        </noise>
      </camera>
      <always_on>1</always_on>
      <visualize>true</visualize>
      <plugin name="Xtion_rgb_camera_controller" filename="libgazebo_ros_camera.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>20.0</updateRate>
        <cameraName>xtion</cameraName>
        <imageTopicName>rgb/image_raw</imageTopicName>
        <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
        <frameName>xtion_rgb_optical_frame</frameName>
        <hackBaseline>0.07</hackBaseline>
        <distortionK1>0.0</distortionK1>
        <distortionK2>0.0</distortionK2>
        <distortionK3>0.0</distortionK3>
        <distortionT1>0.0</distortionT1>
        <distortionT2>0.0</distortionT2>
      </plugin>
    </sensor>
  </gazebo>
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-09-15 19:08:47 -0500

nkoenig gravatar image

I am running Gazebo 1.9 with ROS Hydro and everything seems to work correctly. I did have to install the gazeboplugins from source since there was a bug in the gazeboros_openni plugin (which has since been fixed).

edit flag offensive delete link more

Comments

I installed ROS Hydro and now it works correctly, thanks!

Tirjen gravatar imageTirjen ( 2013-09-18 07:42:31 -0500 )edit
0

answered 2013-09-10 10:06:37 -0500

psei gravatar image

Hi Tirjen,

have you tried <visualize>false</visualize> in the <sensor> ... </sensor> part? The flat pointcloud in RVIZ that you describe could be the real-time projection of the camera image into RVIZ.

Regards

psei

edit flag offensive delete link more

Comments

First of all thank you for your answer. Unfortunately I just tried to add this line in the sensor part but it doesn't work. The very strange fact is that for objects that are closer than one meter the depth information is correct, while for objects that should have the depth>1 the image_raw shows depth=1! I'm editing the question adding two images.

Tirjen gravatar imageTirjen ( 2013-09-10 10:28:13 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-09-10 04:15:55 -0500

Seen: 1,625 times

Last updated: Sep 15 '13