[ros-users] Copypcl::PointCloud<pcl::PointXYZ> to another pcl::PointCloud<pcl::PointXYZ>
Nicolás Alvarez Picco
nicolasapicco at hotmail.com
Mon Dec 6 13:41:34 UTC 2010
Hi!!!
I have pcl::PointCloud<pcl::PointXYZ> as a result of transforming a sensor_msgs::PointCloud2 with the pcl::fromROSMsg(*msglaser, laser_ready) function.
Although my idea is modify that Point cloud, because I want to add some points, I want to do an interpolation. So I want to copy some points directly, I mean in the same order but between others I want to add some points.
Therefore I want to know how to copy in order points from a pcl::PointCloud<pcl::PointXYZ> to another.
I have tried to do that working the point cloud as an array and doing this:
laser_finish.points.push_back(laser_ready.points[it] ( where laser_finish and laser_ready are pcl::PointCloud<pcl::PointXYZ>)
But I have always this error:
control: /home/robot/src/ros/stacks/point_cloud_perception/pcl/include/pcl/ros/conversions.h:176: void pcl::toROSMsg(const pcl::PointCloud<PointT>&, sensor_msgs::PointCloud2&) [with PointT = pcl::PointXYZ]: Assertion `cloud.points.size () == cloud.width * cloud.height' failed.
server: /home/robot/src/ros/stacks/point_cloud_perception/pcl/include/pcl/ros/conversions.h:176: void pcl::toROSMsg(const pcl::PointCloud<PointT>&, sensor_msgs::PointCloud2&) [with PointT = pcl::PointXYZ]: Assertion `cloud.points.size () == cloud.width * cloud.height' failed.
The thing is that I have looked into the pcl function, but I didn't find nothing that suites with this operation. I would appreciate information,
Thanks in advanced.
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20101206/fea671d9/attachment-0002.html>
More information about the ros-users
mailing list