Unable to compile PCL 3D Object Recognition tutorial in ROS [closed]
Hi, I tried to run the PCL tutorial "3D Object Recognition based on Correspondence Grouping" in ROS.
But when I compiled this file by typing rosmake my_package, I received error messages as follows:
CMakeFiles/recognition.dir/src/correspondence_grouping.o: In function `main':
/home/wei/ros/wei_pcl_tutorial/src/correspondence_grouping.cpp:342: undefined reference to `pcl::GeometricConsistencyGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::recognize(std::vector<Eigen::Matrix<float, 4, 4, 0, 4, 4>, Eigen::aligned_allocator<Eigen::Matrix<float, 4, 4, 0, 4, 4> > >&, std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
/home/wei/ros/wei_pcl_tutorial/src/correspondence_grouping.cpp:329: undefined reference to `pcl::Hough3DGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA, pcl::ReferenceFrame, pcl::ReferenceFrame>::recognize(std::vector<Eigen::Matrix<float, 4, 4, 0, 4, 4>, Eigen::aligned_allocator<Eigen::Matrix<float, 4, 4, 0, 4, 4> > >&, std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
CMakeFiles/recognition.dir/src/correspondence_grouping.o:(.rodata._ZTVN3pcl15Hough3DGroupingINS_12PointXYZRGBAES1_NS_14ReferenceFrameES2_EE[vtable for pcl::Hough3DGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA, pcl::ReferenceFrame, pcl::ReferenceFrame>]+0x1c): undefined reference to `pcl::Hough3DGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA, pcl::ReferenceFrame, pcl::ReferenceFrame>::clusterCorrespondences(std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
CMakeFiles/recognition.dir/src/correspondence_grouping.o:(.rodata._ZTVN3pcl28GeometricConsistencyGroupingINS_12PointXYZRGBAES1_EE[vtable for pcl::GeometricConsistencyGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA>]+0x1c): undefined reference to `pcl::GeometricConsistencyGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::clusterCorrespondences(std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
I'm using perception_pcl_electric_unstable which should contain PCL 1.6.
Is there anything I did wrong?
Thanks for helping!
r u getting the same error when u run it on PCL rather than using it in ROS?
No, I have'nt used standalone PCL before.
This is a linker error. So try out once in PCL standalone and see if you are able to compile it successfully. In that case you can post it in the pcl mailing list where you will get the response quickly.