PCLPointCloud2 v.s. PointCloud
Asked Answered
S

2

21

I want to know the difference(s) between pcl::PCLPointCloud2 and pcl::PointCloud in PointCloud Library (PCL). There is a function to convert from one to another, but the documentation is very poor. I would like to know, which one is newer?

p.s. (I am not talking about ROS)

Spectacled answered 23/1, 2014 at 15:18 Comment(1)
To save others time, the conversion functions are pcl::toPCLPointCloud2 and pcl::fromPCLPointCloud2 (source).Jaclynjaco
S
4
  1. PCL has replaced the "sensor_msgs::PointCloud2" type to "pcl::PCLPointCloud2".

  2. PointCLoud2 is a ROS message type.

=> So you had to use the PCLPointCloud2 type in PCL when you want to have interactions with ROS.

Scintillation answered 26/1, 2014 at 8:53 Comment(3)
take a look at these documentations: ROS: wiki.ros.org/hydro/Migration#PCL PCL: github.com/PointCloudLibrary/pcl/wiki/Remove-ROSScintillation
from Radu B. Rusu: "we're hoping to deprecate _msgs/ (and thus PointCloud2 too) in the near future, in the 2.x trunk. "Scintillation
Thanks for the answer, but for example in the "read PCD" tutorial of the PointCloud I read: "Alternatively, you can read a PCLPointCloud2 blob (available only in PCL 1.x). Due to the dynamic nature of point clouds, we prefer to read them as binary blobs, and then convert to the actual representation that we want to use.", Does it mean that PCLPointCloud2 is obsolete?Spectacled
S
0

When you subscribe or publish, you don't need to convert them. #include "pcl_ros/point_cloud.h" will do that for you (called serialization). For more detail, take a look here: http://wiki.ros.org/pcl/Overview#Subscribing_to_different_point_cloud_message_types. Look for the paragraph starting at "If you have a pcl::PointCloud object, you don't have to convert it to a message:"

Stairway answered 24/3, 2017 at 23:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.