Robotics StackExchange | Archived questions

Unable to compile PCL 3D Object Recognition tutorial in ROS

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 perceptionpclelectric_unstable which should contain PCL 1.6.

Is there anything I did wrong?

Thanks for helping!

Asked by Mchaiiann on 2012-06-10 22:44:53 UTC

Comments

r u getting the same error when u run it on PCL rather than using it in ROS?

Asked by karthik on 2012-06-11 00:07:15 UTC

No, I have'nt used standalone PCL before.

Asked by Mchaiiann on 2012-06-11 04:56:10 UTC

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.

Asked by karthik on 2012-06-11 05:06:44 UTC

Answers

I am new to ROS and PCL, but would like to do the similar work with you. Could you please tell me how to use PCL in ROS? Many thanks.

Asked by Xiang on 2014-03-04 08:47:00 UTC

Comments

Follow the pcl tutorials here http://wiki.ros.org/pcl/Tutorials. Its very descriptive and well documented.

Asked by blackmamba591 on 2016-02-10 16:05:13 UTC