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

PCL version 1.11, subscribe to pointcloud fails

asked 2020-08-05 11:16:41 -0600

Chao Chen gravatar image

updated 2020-08-06 05:02:41 -0600

gvdhoorn gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-08-06 05:13:20 -0600

bob-ROS gravatar image

Hard to see without your code but I assume you are trying to subscribe using the pcl::pointcloud message type?

One generally uses the sensor_msg::PointCloud2 message type for communication then converts it to and from the pcl type using pcl::toROSMsg(...) and pcl::fromROSMsg(...).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2020-08-05 11:16:41 -0600

Seen: 467 times

Last updated: Aug 06 '20