makeShared ()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

makeShared ()

Radu B. Rusu
Administrator
We just added something that is potentially useful to the pcl::PointCloud<T> class:

144       inline Ptr makeShared () const { return (boost::make_shared<PointCloud<PointT> >) (*this); }


This helps simplify the code quite a bit. Examples:

-  vfh.setInputCloud (boost::make_shared <PointCloud<PointXYZ> > (cloud));
+  vfh.setInputCloud (cloud.makeShared ());


-  boost::shared_ptr<PointCloud<Normal> > normalsptr = boost::make_shared<PointCloud<Normal> > (normals);
+  PointCloud<Normal>::Ptr normalsptr = normals.makeShared ();


Not sure if we need the shared_ptr<const PointCloud> for now, but we can talk about it / add it later.

--
Cheers,
Radu.

_______________________________________________
[hidden email] / http://pcl.ros.org
https://code.ros.org/mailman/listinfo/pcl-users