ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Converting PointCloud2 into XYZ co-ordinates

asked 2020-10-06 10:06:02 -0500

AncientLord gravatar image

Hello Community,

I am new to ROS. I am using Asus Xtion Pro Live (Depth Camera) with Raspberry Pi4 and ROS Melodic. I used Opneni2_launch package form ROS to integrate the depth camera on raspberry Pi. i am able to see the pointclouds and depth image in RVIZ.

Now I want to extract the XYZ co-ordinates from the PointCloud2 message. Especially, I want to know how many points corresponds to the black/invalid part of the depth image. I am using python to achieve this. how can i get the xyz coordinates?

edit retag flag offensive close merge delete



I am trying to detect calculate the valid and invalid points in a depth image. My idea is that the points with depth lesser than 50cm can be classified as invalid (the black pixels in the depth image). Has anyone tried this or achieved this?

AncientLord gravatar image AncientLord  ( 2020-10-12 07:35:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-06 11:24:55 -0500

JackB gravatar image

Some answers to this same question are already on RA, see this question and answer in particular. If you have a more specific question please provide more details, otherwise I think that question and answers has enough information.

edit flag offensive delete link more


i tried all the suggested answers. However, i still can not see the xyz coordinates. I want to save the extracted XYZ coordinates in a file.

AncientLord gravatar image AncientLord  ( 2020-10-07 03:17:17 -0500 )edit

Question Tools

1 follower


Asked: 2020-10-06 10:06:02 -0500

Seen: 1,462 times

Last updated: Oct 06 '20