ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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=""> >&’

my code in the callback

void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& cloud) {
   pcl::PointCloud<pcl::pointxyzi>::Ptr pcl::PointCloud<pcl::PointXYZI>::Ptr outCld (new pcl::PointCloud<pcl::pointxyzi>);

pcl::PointCloud<pcl::PointXYZI>); // Convert the sensor_msgs/PointCloud2 data to pcl/PointCloud pcl::fromROSMsg (*cloud, *outCld); testCloud.pointDataTemp = outCld;

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=""> pcl::PointCloud<pcl::PointXYZ> >::shared_ptr(const boost::shared_ptr<pcl::pointcloud<pcl::pointxyzi> 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=""> Ap> boost::shared_ptr::shared_ptr(Ap, typename boost::detail::sp_enable_if_auto_ptr<ap, int="">::type)
boost::detail::sp_enable_if_auto_ptr<Ap, int>::type)
  /usr/include/boost/smart_ptr/shared_ptr.hpp:279:14: note: template<class y=""> 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>&, 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>&, 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>&, 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>&, 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)
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>&, Y> boost::shared_ptr::shared_ptr(const boost::shared_ptr<Y>&, typename boost::detail::sp_enable_if_convertible<y, t="">::type)
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>&, 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>&)
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, 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, 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)
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>]
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=""> pcl::PointCloud<pcl::PointXYZ> >::shared_ptr(const boost::shared_ptr<const pcl::pointcloud<pcl::pointxyz=""> 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> boost::shared_ptr<pcl::PointCloud<pcl::PointXYZI> >’ to ‘const boost::shared_ptr<const pcl::pointcloud<pcl::pointxyz=""> >&’

pcl::PointCloud<pcl::PointXYZ> >&’