ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

how to find distance and angle b/w each points in a point cloud and the Kinect sensor

asked 2016-06-21 16:51:08 -0500

AbhijithNair gravatar image

updated 2016-06-30 07:20:08 -0500

Question : how to find distance and angle b/w each points in a point cloud and the Kinect sensor?

Details : Using the code provided in ROS PCL tutorial I subscribed to sensor message and generated a point cloud. Now I want to know how to find out the distance and angle b/w the point in the point cloud and the camera. There is a misconception that point (x,y,z) in which z gives the distance from the camera to a point. If anybody got a solution, please post the answer in detail.


edit retag flag offensive close merge delete



If nobody answers your question, it's likely that either nobody knows, or that the people that do know haven't seen it. It's not like we're purposefully ignoring you.

In any case: could you please revert the edit to your question and post what you have now as an answer? Then accept your own answer.

gvdhoorn gravatar image gvdhoorn  ( 2016-06-30 03:40:01 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-06-30 07:15:26 -0500

AbhijithNair gravatar image

updated 2022-08-05 14:44:42 -0500


Hi, guys.

I figured a way to find out the point which is closer to the camera from the point cloud. I shall share the code on the following link hoping that it might help you guys, also I shall try to provide some insight into the code. Before reading my code I would recommend you have a better understanding of coordinate frame conventions for the camera ( ). I'm sharing the code in the below link.


edit flag offensive delete link more



Thanks for sharing your code but it is better to share it in github.

Stepstorun.txt: You don't need 7 shells to execute your commands:

ROSkinect gravatar image ROSkinect  ( 2016-06-30 10:26:51 -0500 )edit

Shell: $ roslaunch openni_launch openni.launch New shell: $ cd ~/catkin_ws $ catkin_make $ source devel/setup.bash $ rosrun test pub_kfc New shell: $ source devel/setup.bash $ rosrun test sub_kfc
New shell: $ rosrun rviz rviz New shell: $ roslaunch turtlebot_rviz_launchers view_rob

ROSkinect gravatar image ROSkinect  ( 2016-06-30 10:31:22 -0500 )edit

Yeah.. i shall upload the whole project into github once i complete it. I know it is too awk to say i have no experience working with github. anyway thanks for your suggestion. i will consider that for my next upload. Hope my code helps and if its help, please flag it for others. Thanks

AbhijithNair gravatar image AbhijithNair  ( 2016-06-30 11:59:20 -0500 )edit

@mr.AbhijithNair could you please tell me how you convert Kinect data to point cloud. which packages did you use? could you please elaborate on how to find the distance from Kinect sensor in a stepwise.

thanks in advance

GLV gravatar image GLV  ( 2019-04-16 04:46:34 -0500 )edit

answered 2017-10-27 05:45:04 -0500

akengi gravatar image

you are awesome !! I have spent looking for this for more than 1 year.. finally saw your page after so long! Thanks for sharing! Would love to see your progress!!!

edit flag offensive delete link more


thanks mate.. glad i could help you

AbhijithNair gravatar image AbhijithNair  ( 2017-12-05 00:21:01 -0500 )edit

@AbhijithNair Hi, would you please give me the access to the code? I have the same question. thanks

Delbina gravatar image Delbina  ( 2022-08-05 08:41:07 -0500 )edit

@Delbina, you can find the source code here

AbhijithNair gravatar image AbhijithNair  ( 2022-08-05 14:44:10 -0500 )edit

@AbhijithNair thanks a lot, do you have any python code related to this one?

Delbina gravatar image Delbina  ( 2022-08-05 15:08:06 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-06-21 16:51:08 -0500

Seen: 2,793 times

Last updated: Aug 05 '22