0
$\begingroup$

Rosanswers logo

Hi guys, I am quite new to ROS. What I've been trying to do is to obtain the depth data detected by Kinect in order to figure out how these data related to the actual distance.
The project I am using is Openni_Kinect. After launching it, I tried to get the depth information by using rostopic echo camera/depth/image as it provides Unrectified depth image with float depths in m. However, what I got is a huge amount of numbers like 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 120, 148, 65, 75, 120, 148, 65, 75, 120, 148, 65, 75, 120, 148, 65...
So does anyone know what these number represent? Or am I doing it right? Do I need to switch to OpenNI to directly get the depth data?
Thanks in advance!


Originally posted by alexQ on ROS Answers with karma: 3 on 2011-10-19

Post score: 0


Original comments

Comment by LiMuBei on 2011-10-19:
If you're interested in raw Kinect data, I think using OpenNI directly is probably better.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

rostopic does not handle float images correctly and will instead interpret the data as an array of unsigned characters (bytes), which is what you see.

If you only want to have a look at what the depth image looks like, you can display it using image_view:

rosrun image_view image_view image:=/camera/depth/image

If you need access to the raw float data, you should write a small node that subscribes and processes these float images. Check this tutorial


Originally posted by sebsch with karma: 790 on 2011-10-19

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by alexQ on 2011-10-23:
Thanks for your reply. Just as you said, the data provided by the topic /camera/depth/image_raw is actually what I wanted.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.