I have a problem.
I cannot correctly push back to a vector a class which has a Ptr point cloud as member variable. More specifically, I have a plane class:
void setCloud(PointCloudType::Ptr cld);
void PlanePrimitives::setCloud(PointCloudType::Ptr cld)
// Here I have tried many other method to set cloud, such as
// cloud = cld;
// cloud = PointCloudType::Ptr(new PointCloudType(*cld));
// and so on.
// They all works in copy cld to cloud.
for (size_t i = 0; i < cld->size();i++)
It does not work in blow code somewhere:
... // Fill cld with some points here.
std::vector<PlanePrimitives, Eigen::aligned_allocator<PlanePrimitives>> vecPlanesPrimitives;
PlanePrimitives plane; // Initialize its other member variables.
plane.setCloud(cld); // When debugging, here points of plane.cloud is the same as cld's.
// Here vecPlanesPrimitives.cloud is empty!!!! So are its other member variables.
Would you point me out what I have missed. Should I do something special in this circumstance?