for(int i=0;i<cloud->points.size();i++)
{
if(cloud->points[i].x>0)
{
cloud->points[i].z=0;
double rad=asin(cloud->points[i].x/radius);
cloud->points[i].x=rad*radius;
}
if(cloud->points[i].x<0)
{
cloud->points[i].z=0;
double rad=asin(abs(cloud->points[i].x)/radius);
cloud->points[i].x=rad*radius*-1;
}
}
通过cloud->points.size()获取点云数量,然后便利所有点云,将圆柱点云利用弧长展开成平面点云用于后续生成octomap