点云赋值 PointCloudT::Ptr 运行时崩溃

PointCloudT::Ptr cloud;
cloud.reset(new PointCloudT);
cloud->points.resize(500);
for(int index =0;index <500;index++)
{
  cloud->point[index].x = 1.0;
cloud->point[index].y =1.0;
}
采用以上方式赋值程序崩溃。
Point t;
for(int index =0;index <500;index++)
{
  t.x =1.0;
t.y =1.0;
cloud->pushback(t);
}
采用这种方式ok。



原文地址:https://www.cnblogs.com/kabe/p/9542295.html