my code in the callback
void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& cloud) {
pcl::PointCloud<pcl::PointXYZI>::Ptr outCld (new pcl::PointCloud<pcl::PointXYZI>);
// Convert the sensor_msgs/PointCloud2 data to pcl/PointCloud
pcl::fromROSMsg (*cloud, *outCld);
testCloud.pointDataTemp = outCld;
pub_Cld1.publish (testCloud.pointDataVoxel); //bottom
}
the error
instantiated from here
/usr/include/boost/smart_ptr/shared_ptr.hpp:314:9: error: no matching function for call to ‘boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >::shared_ptr(const boost::shared_ptr<pcl::PointCloud<pcl::PointXYZI> >&)’
/usr/include/boost/smart_ptr/shared_ptr.hpp:314:9: note: candidates are:
/usr/include/boost/smart_ptr/shared_ptr.hpp:289:14: note: template<class Ap> boost::shared_ptr::shared_ptr(Ap, typename boost::detail::sp_enable_if_auto_ptr<Ap, int>::type)
/usr/include/boost/smart_ptr/shared_ptr.hpp:279:14: note: template<class Y> boost::shared_ptr::shared_ptr(std::auto_ptr<_Tp1>&)
/usr/include/boost/smart_ptr/shared_ptr.hpp:268:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, boost::detail::polymorphic_cast_tag)
/usr/include/boost/smart_ptr/shared_ptr.hpp:259:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, boost::detail::dynamic_cast_tag)
/usr/include/boost/smart_ptr/shared_ptr.hpp:254:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, boost::detail::const_cast_tag)
/usr/include/boost/smart_ptr/shared_ptr.hpp:249:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, boost::detail::static_cast_tag)
/usr/include/boost/smart_ptr/shared_ptr.hpp:244:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, T*)
/usr/include/boost/smart_ptr/shared_ptr.hpp:231:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, typename boost::detail::sp_enable_if_convertible<Y, T>::type)
/usr/include/boost/smart_ptr/shared_ptr.hpp:220:5: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::weak_ptr<Y>&, boost::detail::sp_nothrow_tag)
/usr/include/boost/smart_ptr/shared_ptr.hpp:213:14: note: template<class Y> boost::shared_ptr::shared_ptr(const boost::weak_ptr<Y>&)
/usr/include/boost/smart_ptr/shared_ptr.hpp:205:41: note: template<class Y, class D, class A> boost::shared_ptr::shared_ptr(Y*, D, A)
/usr/include/boost/smart_ptr/shared_ptr.hpp:198:32: note: template<class Y, class D> boost::shared_ptr::shared_ptr(Y*, D)
/usr/include/boost/smart_ptr/shared_ptr.hpp:187:14: note: template<class Y> boost::shared_ptr::shared_ptr(Y*)
/usr/include/boost/smart_ptr/shared_ptr.hpp:182:5: note: boost::shared_ptr< <template-parameter-1-1> >::shared_ptr() [with T = const pcl::PointCloud<pcl::PointXYZ>]
/usr/include/boost/smart_ptr/shared_ptr.hpp:182:5: note: candidate expects 0 arguments, 1 provided
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >::shared_ptr(const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&)
/usr/include/boost/smart_ptr/shared_ptr.hpp:168:25: note: no known conversion for argument 1 from ‘const boost::shared_ptr<pcl::PointCloud<pcl::PointXYZI> >’ to ‘const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&’
Please post your error. Just saying 'I get an error' is not helpful. http://ros.org/wiki/Support#Guidelines_for_asking_a_question_.28Please_read_before_posting.29