Items with no label
3338 Discussions

How do I get the x y z coordinates from the depth stream?

JKjel1
Novice
6,884 Views

Hi,

 

I am using the RealSense D435 camera. I want to obtain the x y z coordinates from the /camera/depth/image_rect_raw topic for each frame. How do I do this?

 

The message format of the topic gives me a parameter Data[] which gives me depth values from 0 to 255 for each pixel but I want the x y z coordinates.

 

The RealSense SDK can create a pointcloud, is it possible to get the coordinates from each point in the pointcloud?

 

 

 

0 Kudos
1 Solution
JKjel1
Novice
6,162 Views

I tried the link where it says that I should launch rs_rgbd.launch and then I should get the information from pointcloud2. But when I try this I can't find a topic named "pointcloud2".

 

I then tried the second answer, which I think works. I use the x and y position from the Data[] array and the corresponding z value (between 0-255). This way I can get x,y,z but I was not sure this was the correct way to tackle this problem, but from the second answer I guess it is. So I don't think I need furter assistance. Thank you!

View solution in original post

0 Kudos
3 Replies
Eliza_D_Intel
Employee
6,164 Views
Hello JKjel1, Thank you for your interest in the Intel RealSense D435 camera. You can check out this post on GitHub where is explained how to get x,y,z values from the pointcloud : https://github.com/IntelRealSense/librealsense/issues/1712 Thank you and best regards, Eliza
0 Kudos
Eliza_D_Intel
Employee
6,162 Views
Hello JKjel1, Could you please let us know if you require further assistance on this topic? Thank you, Eliza
0 Kudos
JKjel1
Novice
6,163 Views

I tried the link where it says that I should launch rs_rgbd.launch and then I should get the information from pointcloud2. But when I try this I can't find a topic named "pointcloud2".

 

I then tried the second answer, which I think works. I use the x and y position from the Data[] array and the corresponding z value (between 0-255). This way I can get x,y,z but I was not sure this was the correct way to tackle this problem, but from the second answer I guess it is. So I don't think I need furter assistance. Thank you!

0 Kudos
Reply