0
$\begingroup$

Rosanswers logo

Hello,

I want to get the distance of an object from the depth sensor(Primesense). I am able to subscribe to all the topics. I am not sure which one to use for my purpose. I tried using "/camera/depth_registered/image_rect_raw" topic.

I have the following information from the topic:

Image Height: 480
Image Width: 640
Encoding: 16UC1
Is Big Endian ?: 0
Step: 1280

The data looks like this:

2  86  2  85  2  85  2  85  2  84  2  84  2  83  2  82  2  82  2  82  2  82  2  82  2  82  2  82  2  82  2  81  2  81  2  81  2  81  2  80  2  80  2  78  2  77  2  75  2  75  2  63  2  63  2  62  2  61  2  60  2  59  2  59  2  58  2  58  2  57  2  57  2  57  2  57  2  56  2  57  2  56  2  57  2  58  2  58  2  58  2  58 ..............

But I don't know what these array of bytes indicate. It would be very helpful if someone can teach me How to get the distance from this data?

Thanks in advance.


Originally posted by Keerthi Raj on ROS Answers with karma: 7 on 2013-12-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi there!

It would be easier for you to subscribe to the topic "/camera/depth/points". This topic provides you already with a 3D point cloud extracted from the depth sensor ready to use. The topic's type is PointCloud2 and you can access X, Y and Z values for each point using PCL.

I hope this helps.


Originally posted by Martin Peris with karma: 5625 on 2013-12-16

This answer was ACCEPTED on the original site

Post score: 5

$\endgroup$

Your Answer

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