koide3 / hdl_graph_slam

3D LIDAR-based Graph SLAM
BSD 2-Clause "Simplified" License
1.93k stars 723 forks source link

ERROR: pcl_conversions related build error #231

Open shurikrulik opened 2 years ago

shurikrulik commented 2 years ago

Hello @koide3 !

I know that there is some widely known issue with different pcl and pcl_conversions versions. Now i faced with this trouble again, and tried many different combinations of pcl versions, but there's now effect. Now i try with: Ubuntu 18.04 ros melodic pcl-1.8.1 pcl-conversions and pcl-ros = 1.7.3-1bionic.20210921.210553

Here is my build error log: /home/devel/hdl_catkin_ws/src/pcl_conversions/include/pcl_conversions/pcl_conversions.h:311:25: error: no match for ‘operator=’ (operand types are ‘std::vector<int>’ and ‘const _indices_type {aka const std::vector<long unsigned int, std::allocator<long unsigned int> >}’) pcl_pi.indices = pi.indices; ^~~~~~~ In file included from /usr/include/c++/7/vector:69:0, from /usr/include/boost/math/special_functions/math_fwd.hpp:26, from /usr/include/boost/math/special_functions/round.hpp:15, from /opt/ros/melodic/include/ros/time.h:58, from /opt/ros/melodic/include/ros/ros.h:38, from /home/devel/hdl_catkin_ws/src/hdl_graph_slam/apps/floor_detection_nodelet.cpp:6: /usr/include/c++/7/bits/vector.tcc:179:5: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>] vector<_Tp, _Alloc>:: ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/7/bits/vector.tcc:179:5: note: no known conversion for argument 1 from ‘const _indices_type {aka const std::vector<long unsigned int, std::allocator<long unsigned int> >}’ to ‘const std::vector<int>&’ In file included from /usr/include/c++/7/vector:64:0, from /usr/include/boost/math/special_functions/math_fwd.hpp:26, from /usr/include/boost/math/special_functions/round.hpp:15, from /opt/ros/melodic/include/ros/time.h:58, from /opt/ros/melodic/include/ros/ros.h:38, from /home/devel/hdl_catkin_ws/src/hdl_graph_slam/apps/floor_detection_nodelet.cpp:6: /usr/include/c++/7/bits/stl_vector.h:461:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>] operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:461:7: note: no known conversion for argument 1 from ‘const _indices_type {aka const std::vector<long unsigned int, std::allocator<long unsigned int> >}’ to ‘std::vector<int>&&’ /usr/include/c++/7/bits/stl_vector.h:482:7: note: candidate: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>] operator=(initializer_list<value_type> __l) ^~~~~~~~ /usr/include/c++/7/bits/stl_vector.h:482:7: note: no known conversion for argument 1 from ‘const _indices_type {aka const std::vector<long unsigned int, std::allocator<long unsigned int> >}’ to ‘std::initializer_list<int>’ In file included from /opt/ros/melodic/include/pcl_ros/point_cloud.h:9:0, from /home/devel/hdl_catkin_ws/src/hdl_graph_slam/apps/floor_detection_nodelet.cpp:8: /home/devel/hdl_catkin_ws/src/pcl_conversions/include/pcl_conversions/pcl_conversions.h: In function ‘void pcl_conversions::moveToPCL(pcl_msgs::PointIndices&, pcl::PointIndices&)’: /home/devel/hdl_catkin_ws/src/pcl_conversions/include/pcl_conversions/pcl_conversions.h:318:35: error: no matching function for call to ‘std::vector<int>::swap(pcl_msgs::PointIndices_<std::allocator<void> >::_indices_type&)’ pcl_pi.indices.swap(pi.indices); ^ In file included from /usr/include/c++/7/vector:64:0, from /usr/include/boost/math/special_functions/math_fwd.hpp:26, from /usr/include/boost/math/special_functions/round.hpp:15, from /opt/ros/melodic/include/ros/time.h:58, from /opt/ros/melodic/include/ros/ros.h:38, from /home/devel/hdl_catkin_ws/src/hdl_graph_slam/apps/floor_detection_nodelet.cpp:6: /usr/include/c++/7/bits/stl_vector.h:1229:7: note: candidate: void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>] swap(vector& __x) _GLIBCXX_NOEXCEPT

Is there any approach to resolve this issue ?

koide3 commented 2 years ago

We always see many problems when mixing different versions of PCL... I recommend using the docker environment to avoid the issues.