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

Linker error with PCL recognition module in ros melodic

asked 2020-01-27 06:58:39 -0500

iv gravatar image

updated 2020-01-27 07:04:41 -0500

gvdhoorn gravatar image

Hi,

While compiling the pcl object recognition code with ros, following error has occurred.

Tried out the same in PCL standalone, and it compiles successfully.

Platform: Ubuntu 18.04.3 LTS ; ros-melodic; perception_pcl pcl-1.8.1

Error:

CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o: In function `cloud_callback(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)':
object_recognition.cpp:(.text+0x23c5): 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> > > >&)'
object_recognition.cpp:(.text+0x2560): 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> > > >&)'
object_recognition.cpp:(.text+0x2f36): undefined reference to `pcl::GlobalHypothesesVerification<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::verify()'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl28GlobalHypothesesVerificationINS_12PointXYZRGBAES1_EE[_ZTVN3pcl28GlobalHypothesesVerificationINS_12PointXYZRGBAES1_EE]+0x10): undefined reference to `pcl::GlobalHypothesesVerification<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::verify()'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl28GeometricConsistencyGroupingINS_12PointXYZRGBAES1_EE[_ZTVN3pcl28GeometricConsistencyGroupingINS_12PointXYZRGBAES1_EE]+0x58): 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> > > >&)'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl15Hough3DGroupingINS_12PointXYZRGBAES1_NS_14ReferenceFrameES2_EE[_ZTVN3pcl15Hough3DGroupingINS_12PointXYZRGBAES1_NS_14ReferenceFrameES2_EE]+0x58): 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> > > >&)'
collect2: error: ld returned 1 exit status
orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/build.make:310: recipe for target '/home/girishkumar/catkin_ws/devel/lib/pcl_pkgs/object_recognition' failed
make[2]: *** [/home/girishkumar/catkin_ws/devel/lib/pcl_pkgs/object_recognition] Error 1
CMakeFiles/Makefile2:13407: recipe for target 'orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/all' failed
make[1]: *** [orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Do I need to add any component other than pcl_conversions, pcl_ros, roscpp, sensor_msgs.

Please Help.

Thank you.

edit retag flag offensive close merge delete

Comments

Hi,

I also encountered the same problem, have you solved it?

Thank you.

voyage03 gravatar image voyage03  ( 2020-08-06 08:16:37 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-04-05 04:39:58 -0500

kikira gravatar image

updated 2021-04-19 02:22:34 -0500

Hi, have you solved it? I have the same problem. I use PCL-1.8 which include in ros melodic. I am wondering if build PCL from source will solve this problem.Thank you.


Hi, Now I compile PointCloudLibrary(PCL)from source code which I download from Github,and there is no more this problem. If you are using the PCL that comes with ROS, you can try this solution.Remember to change the CMakeLists.txt. I hope this can help you.Thanks.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-01-27 06:58:39 -0500

Seen: 291 times

Last updated: Apr 19 '21