# Kinect PointCloud values [closed]

Hello, I'm using depth/points topic published by kinect controller gazebo_ros_openni_kinect. My problem is that, even if an obstacle is set at distance 2.0, selecting the minimum depth point (no other obstacles in the scene) it always returns 1.0 depth (and relatives x-y coords). Now, all these coords should be in meters, so I can't reach my objective of obtaining the coord of the mimimum depth point in the scene (for obstacle avoidance purposes). Thank you.

EDIT: An other big problem is that, moving the robot, this depth measurement changes only when it is really close to the obstacle! How can I solve it?

EDIT #2: The .xacro of the kinect is:

    <gazebo reference="objective">
<sensor:camera name="cam_sensor">
<updateRate>20.0</updateRate>
<!--            <imageFormat>B8G8R8</imageFormat>-->
<imageSize>640 480</imageSize>
<hfov>58</hfov>
<nearClip>0.1</nearClip>
<farClip>100</farClip>
<controller:gazebo_ros_openni_kinect name="kin_controller" plugin="libgazebo_ros_openni_kinect.so">
<cameraName>kinect</cameraName>
<alwaysOn>true</alwaysOn>
<!--                <CxPrime>320</CxPrime>-->
<!--                <Cx>320</Cx>-->
<!--                <Cy>240</Cy>-->
<!--                <focal_length>320</focal_length> <! image_width / (2*tan(hfov_radian /2)) >-->
<imageTopicName>rgb/image</imageTopicName>
<cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
<depthImageTopicName>depth/image</depthImageTopicName>
<depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
<pointCloudTopicName>points</pointCloudTopicName>
<pointCloudCutoff>0.5</pointCloudCutoff>
</controller:gazebo_ros_openni_kinect>
</sensor:camera>


which is included in another .xacro file (and then in a .launch):

<kinectSensor parent="chassis_link"><origin xyz="0.05 0 ${chassis_height+topTable_height+topCyl_height+laserCylHeight+laserBaseSide+0.015}" rpy="0 0 0"/></kinectSensor>  EDIT #3: Could it be the plane on which the obstacle and the robot stay which always gives depth = 1.0? How can I solve, if it is the problem? EDIT #4: That's what I obtain from rviz: http://imageshack.us/photo/my-images/27/screenshotxyt.png/ It seems everything has the same depth... and the floor is a big problem! edit retag reopen merge delete ### Closed for the following reason question is not relevant or outdated by tfoote close date 2015-04-23 03:30:43.441082 ## Comments Could the problem be that you have Kinect on a robot at the height of 1m and you query for the depth in the Z coordinate of the base_link frame where that Z is constantly 1m? Which launch file are you using? ( 2012-09-23 13:08:59 -0500 )edit No, because my kinect is at height 0.71 and I'm considering the z in the point cloud frame (which should be the depth). Furthermore, as I said, the Z values changes only when I'm really close to the obstacle (for example: when i'm going to touch the obstacle I obtain 0.58 for Z). ( 2012-09-23 22:21:39 -0500 )edit To me the xacro file looks OK. Can you visualize the robot and the point cloud in rviz? As a last resort, could provide the whole code (best as a ROS package)? ( 2012-09-24 10:33:17 -0500 )edit rviz crashes with segmentation fault, even if (as I found) delete the HOME/.rviz directory. I'm not sure I can provide the whole code, it doesn't depend on me. ( 2012-09-24 11:30:18 -0500 )edit Ok, some news: I solved the problem with rviz. I tried to subscribe many different topics from my kinect: /kinect/rgb/image works perfectly. From /kinect/depth/image I obtain only a NO IMAGE error (why?!). From /kinect/points I obtain only a little box which never changes even if the robot moves. ( 2012-09-24 22:47:59 -0500 )edit I am really not sure what is going on your side. I ran the roslaunch pr2_gazebo pr2_empty_world.launch today and these are the resulting point cloud and depth image that I get in rviz: http://imageshack.us/a/img19/5182/kinectgazeboplugin.png. ( 2012-09-25 13:25:15 -0500 )edit Maybe you can try and follow that pr2_empty_world.launch and see how they include their Kinect sensor. I think that in the end the following file gets included: <include filename="$(find pr2_description)/urdf/sensors/kinect_prosilica_camera.urdf.xacro" />

( 2012-09-25 13:39:25 -0500 )edit

I really don't know, it's completely different. However, the real strange thing is that my max depth value is 1.0!

( 2012-09-25 21:09:09 -0500 )edit