anti
anti

Reputation: 3125

Initialize a PCL PointCloud::Ptr?

This is very likely s a simple thing, but I am stuck. I am trying to initialize a Point Cloud Library Point cloud in a header file, so that I can share it across functions.

I am trying:

//.h

typedef pcl::PointCloud<pcl::POINT_TYPE> PointCloud;

PointCloud::Ptr currCloud;

//.cpp

currCloud= new pcl::PointCloud<pcl::PointXYZI>;

But this gives me

no operator '=' matches these operands

How can i initialize this type?

Thank you.

Upvotes: 0

Views: 5788

Answers (1)

Scott Mudge
Scott Mudge

Reputation: 977

In PCL, the point types have to match between declaration and definitions.

Change

typedef pcl::PointCloud<pcl::POINT_TYPE> PointCloud;

to

typedef pcl::PointCloud<pcl::PointXYZI> PointCloud;

In your header.

Upvotes: 1

Related Questions