[ros-users] Copypcl::PointCloud<pcl::PointXYZ> to another pcl::PointCloud<pcl::PointXYZ>

Radu Bogdan Rusu rusu at willowgarage.com
Mon Dec 6 18:40:57 UTC 2010


Nicolas,

As always, some concrete code that shows what you're trying to do helps us _tremendously_ in understanding the problem 
and providing you with an adequate answer :)

Cheers,
Radu.
--
http://pointclouds.org

On 12/06/2010 05:41 AM, Nicolás Alvarez Picco wrote:
> 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
>
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users



More information about the ros-users mailing list