PCL version 1.11, subscribe to pointcloud fails
I follow the tutorial in http://wiki.ros.org/pcl_ros. However, it only works in PCL 1.8. From version 1.11, they change share pointer from boost to std. The error is like following :
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::void_function_invoker1<FunctionPtr, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with FunctionPtr = void (*)(const std::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&); R = void; T0 = const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&]’:
/usr/include/boost/function/function_template.hpp:925:38: required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = void (*)(const std::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&); R = void; T0 = const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&]’
/usr/include/boost/function/function_template.hpp:716:7: required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type) [with Functor = void (*)(const std::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&); R = void; T0 = const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&; typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type = int]’
/usr/include/boost/function/function_template.hpp:1061:16: required from ‘boost::function<R(T0)>::function(Functor, typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type) [with Functor = void (*)(const std::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&); R = void; T0 = const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&; typename boost::enable_if_c<(! boost::is_integral<Functor>::value), int>::type = int]’
/home/chao/catkin_ws/src/beginner_tutorials/src/pointcloudlistener.cpp:138:88: required from here
/usr/include/boost/function/function_template.hpp:118:11: error: invalid initialization of reference of type ‘const std::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >&’ from expression of type ‘const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZ> >’
BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS));
^
beginner_tutorials/CMakeFiles/pointcloudlistener.dir/build.make:62: recipe for target 'beginner_tutorials/CMakeFiles/pointcloudlistener.dir/src/pointcloudlistener.cpp.o' failed
make[2]: *** [beginner_tutorials/CMakeFiles/pointcloudlistener.dir/src/pointcloudlistener.cpp.o] Error 1
CMakeFiles/Makefile2:486: recipe for target 'beginner_tutorials/CMakeFiles/pointcloudlistener.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/pointcloudlistener.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
How can I subscribe a point cloud using ROS callback