0

Rosanswers logo

Hello guys,

i'm really struggling with my mind while reading the PCL Documentation on ROS.org. I want to process the registered depth cloud stream of my XTion Pro Live in a cpp file. So i found this :

http://wiki.ros.org/pcl/Tutorials which says

"since we use ROS subscribers and publishers in our code snippet above, we can ignore the loading and saving of point cloud data using the PCD format."

That tutorial talks about a Voxel Snippet in Cpp, on the PCL website http://www.pointclouds.org/documentation/tutorials/voxel_grid.php

What i don't get is : in the PCL Tutorial, it's all about loading a PCD file (it that right ?) and processing that file. But i want to process a live XYZRGB Stream from the Camera. Would i have to convert the stream (pointcloud_to_pcd then pcd_to_pointcloud) everytime to a PCD file ? Or is it possible to input the Topic of my Camera ?

I'm not getting the logic behind all this yet

I hope someone can rescue me in this mind Jungle Thank you


Originally posted by fatstudentsweating on ROS Answers with karma: 5 on 2015-08-04

Post score: 0

1 Answers1

0

Rosanswers logo

You can directly process on the topic, otherwise, it would not make any sense. In the tutorial they are using PCD so that you can do it without a camera.

In the PCL tutorials link you have posted, http://wiki.ros.org/pcl/Tutorials, there is a minimum example on how to do this. You just have to subscribe to:

ros::Subscriber sub = nh.subscribe ("input", 1, cloud_cb); with a callback of type

void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& input)

and that is it. There is even an example on how to process the cloud with a filter.


Originally posted by Javier V. Gómez with karma: 1305 on 2015-08-05

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by fatstudentsweating on 2015-08-05:
Hello Javi, Thanks a lot ! If I can process directly on a topic, will all frames of the camera be processed ? I mean if there are like 15 Point Clouds streaming, will each one be processed ? Simultaneously? This is kind of confusing for me :D sorry if my questions seem weird

Comment by Javier V. Gómez on 2015-08-05:
Unfortunately not all frame will be processed. If the callback is busy doing some processing, it will not be called when a new image arrives (I am not 100% sure that it is like this). But I am sure that you can lose some frames. For that, callbacks should remain as simple as possible.