PointStream to PCL pointcloud

Is there any easy way to convert the Astra::PointStream to a PCL PointCloud? I cannot find much information anywhere… Any help would be greatly appreciated :slight_smile:

To reply to my own question, here is an example(pointCloud is already an astra::PointFrame):

pcl::PointCloud<pcl::PointXYZ>::Ptr pclCloud(new pcl::PointCloud<pcl::PointXYZ>);
for (int i = 0; i < pointCloud.length(); i++) {
    const astra::Vector3f* data = pointCloud.data() + i;
    pcl::PointXYZ p = pcl::PointXYZ(data->x / 1000.0f, data->y / 1000.0f, data->z / 1000.0f);
    pclCloud->points.push_back(p);
  }

For another question, does anyone know why with pointstream we have less points than using openni2 to open the cameras? For instance, with astra sdk, my pointstream is 256.000 total points, with openni2(from pcl), 307.200…

Answering my own question again: The difference of points was due to Depth resolution being set to 640 x 400. Going to where the OpenNI2/Drivers are, editing orbbec.ini and changing the following line:

Resolution=17

to

Resolution=1

solved that issue.