fast_gicp
fast_gicp copied to clipboard
Error occurs [Segmentation fault (core dumped)] when I run gicp_align
I use Ubuntu18.04, ROS melodic and PCL 1.8(build from source).
I use catkin_make to build this project following the README.md https://github.com/SMRT-AIST/fast_gicp#ros
cd ~/catkin_ws/src git clone https://github.com/SMRT-AIST/fast_gicp --recursive cd .. && catkin_make -DCMAKE_BUILD_TYPE=Release
and I build it successfully.(Although there is no error, there are some cmake warnings, I don't know if it matters and how can I fix it). The output message is as follow:
`Base path: /home/dell/lyq/study/fast_gicp Source space: /home/dell/lyq/study/fast_gicp/src Build space: /home/dell/lyq/study/fast_gicp/build Devel space: /home/dell/lyq/study/fast_gicp/devel Install space: /home/dell/lyq/study/fast_gicp/install
Running command: "make cmake_check_build_system" in "/home/dell/lyq/study/fast_gicp/build"
-- Using CATKIN_DEVEL_PREFIX: /home/dell/lyq/study/fast_gicp/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/melodic -- This workspace overlays: /opt/ros/melodic -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") -- Using PYTHON_EXECUTABLE: /usr/bin/python2 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/dell/lyq/study/fast_gicp/build/test_results -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.29 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - fast_gicp -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'fast_gicp' -- ==> add_subdirectory(fast_gicp) -- Boost version: 1.65.1 -- Found the following Boost libraries: -- system -- filesystem -- thread -- date_time -- iostreams -- serialization -- chrono -- atomic -- regex -- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR) ** WARNING ** io features related to ensenso will be disabled -- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) ** WARNING ** io features related to davidSDK will be disabled -- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES) ** WARNING ** io features related to dssdk will be disabled ** WARNING ** io features related to pcap will be disabled ** WARNING ** io features related to png will be disabled -- The imported target "vtkRenderingPythonTkWidgets" references the file "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so" but this file does not exist. Possible reasons include:
- The file was deleted, renamed, or moved to another location.
- An install or uninstall procedure did not complete successfully.
- The installation package was faulty and contained "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake" but not all the files it references.
-- The imported target "vtk" references the file "/usr/bin/vtk" but this file does not exist. Possible reasons include:
- The file was deleted, renamed, or moved to another location.
- An install or uninstall procedure did not complete successfully.
- The installation package was faulty and contained "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake" but not all the files it references.
** WARNING ** io features related to libusb-1.0 will be disabled -- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR) ** WARNING ** visualization features related to ensenso will be disabled -- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR) ** WARNING ** visualization features related to davidSDK will be disabled -- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES) ** WARNING ** visualization features related to dssdk will be disabled -- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES) ** WARNING ** visualization features related to rssdk will be disabled -- looking for PCL_COMMON -- looking for PCL_OCTREE -- looking for PCL_IO -- looking for PCL_KDTREE -- looking for PCL_SEARCH -- looking for PCL_SAMPLE_CONSENSUS -- looking for PCL_FILTERS -- looking for PCL_2D -- looking for PCL_GEOMETRY -- looking for PCL_FEATURES -- looking for PCL_ML -- looking for PCL_SEGMENTATION -- looking for PCL_VISUALIZATION -- looking for PCL_SURFACE -- looking for PCL_REGISTRATION -- looking for PCL_KEYPOINTS -- looking for PCL_TRACKING -- looking for PCL_RECOGNITION -- looking for PCL_STEREO -- looking for PCL_OUTOFCORE -- looking for PCL_PEOPLE -- Configuring done CMake Warning at fast_gicp/CMakeLists.txt:51 (add_library): Cannot generate a safe runtime search path for target fast_gicp because files in some directories may conflict with libraries in implicit directories:
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /usr/local/lib
Some of these libraries may not be found correctly.
CMake Warning at fast_gicp/CMakeLists.txt:68 (add_executable): Cannot generate a safe runtime search path for target gicp_align because files in some directories may conflict with libraries in implicit directories:
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /usr/local/lib
Some of these libraries may not be found correctly.
CMake Warning at fast_gicp/CMakeLists.txt:75 (add_executable): Cannot generate a safe runtime search path for target gicp_kitti because files in some directories may conflict with libraries in implicit directories:
runtime library [libz.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /usr/local/lib
Some of these libraries may not be found correctly.
-- Generating done -- Build files have been written to: /home/dell/lyq/study/fast_gicp/build
Running command: "make -j16 -l16" in "/home/dell/lyq/study/fast_gicp/build"
[ 55%] Built target fast_gicp Scanning dependencies of target gicp_align [ 77%] Built target gicp_kitti [ 88%] Building CXX object fast_gicp/CMakeFiles/gicp_align.dir/src/align.cpp.o In file included from /usr/local/include/pcl-1.8/pcl/sample_consensus/sac_model.h:52:0, from /usr/local/include/pcl-1.8/pcl/sample_consensus/sac.h:45, from /usr/local/include/pcl-1.8/pcl/sample_consensus/ransac.h:44, from /usr/local/include/pcl-1.8/pcl/registration/icp.h:45, from /usr/local/include/pcl-1.8/pcl/registration/gicp.h:44, from /home/dell/lyq/study/fast_gicp/src/fast_gicp/src/align.cpp:11: /usr/local/include/pcl-1.8/pcl/sample_consensus/model_types.h: In function ‘void __static_initialization_and_destruction_0(int, int)’: /usr/local/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations] SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel)); ^~~~~~~~~~~~~~~ /usr/local/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: note: declared here [100%] Linking CXX executable /home/dell/lyq/study/fast_gicp/devel/lib/fast_gicp/gicp_align [100%] Built target gicp_align`
When I try to test the benchmark, the error occurs.
I used : https://github.com/SMRT-AIST/fast_gicp#benchmark
roscd fast_gicp/data rosrun fast_gicp gicp_align 251370668.pcd 251371071.pcd
and I get:
Segmentation fault (core dumped)
I tried to debug, and I find the problem is occur in https://github.com/SMRT-AIST/fast_gicp/blob/master/src/align.cpp#L141
voxelgrid.filter(*filtered);
How can I fix this problem? Thanks.
By the way, I want to ask another question. If I want to use VGICP(use MT and without CUDA) in my own ROS project. Do I just need to put /src/fast_gicp/ficp https://github.com/SMRT-AIST/fast_gicp/tree/master/src/fast_gicp/gicp, /include/fast_gicp/gicp https://github.com/SMRT-AIST/fast_gicp/tree/master/include/fast_gicp/gicp and /include/fast_gicp/so3 https://github.com/SMRT-AIST/fast_gicp/tree/master/include/fast_gicp/so3 folders under my package folders and then modify my CMAKEList and make? Thanks a lot!
- I solve same problem.
First make sure find_package(pcl) found your own pcl instand of system pcl(you can add some message(${PCL_INCLUDE_DIRS})). Then if your own pcl is built default with "--march=native -msse ..." in pcl/build/PCLConfig.cmake, your should make sure it's the same in CMakeLists.txt within fast_gicp.
eg:
set(CMAKE_C_FLAGS "-march=native -msse4.2 -mfpmath=sse")
set(CMAKE_CXX_FLAGS "-march=native -msse4.2 -mfpmath=sse")
otherwise, eigen will have different size between pcl lib and your own gicp_align
- ROS: put fast_gicp to catkin_ws/src with your ros package. Your own ros package should depend on this package like a "sensor_msgs" (find_package and catkin_package( CATKIN_DEPENDS ...)).
then you can simply link fast_gicp.so (target_link_libraries( ...))