Hellow,
I have a template class Main. I'm trying to use one of the function of this class as a callBack for a subscriber but I can't compile my code.
If I put a value in the template :
/home/ros/catkin_ws/src/Tobot/stalker/src/Stalker.cpp:27: undefined reference to `Main<pcl::PointXYZRGBA>::doWork(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)'
If I don't :
/home/ros/catkin_ws/src/Tobot/stalker/src/Stalker.cpp:27:86: erreur: ‘template<class T> class Main’ used without template parameters
make[2]: *** [Tobot/stalker/CMakeFiles/stalker_node.dir/src/Stalker.cpp.o] Erreur 1
The code for those errors would be respectively :
pointcloud_sub = my_node.subscribe<sensor_msgs::PointCloud2> ("cloud_filtered", 1, &Main<pcl::PointXYZRGBA>::doWork, &main);
pointcloud_sub = my_node.subscribe<sensor_msgs::PointCloud2> ("cloud_filtered", 1, &Main::doWork, &main);
Any help to get this working would be appreciated.
Originally posted by Maya on ROS Answers with karma: 1172 on 2014-04-14
Post score: 1