Closed rikpires closed 6 years ago
Hi, you need to install g2o library, I've already added it to the readme file, let me know if you find any other issue.
Hi , after installing g2o by " git clone https://github.com/RainerKuemmerle/g2o.git cd g2o mkdir build cd build cmake .. make sudo make install " the above error still exists . Then I tried to add the following line into CMakeLists.txt :
set(G2O_DIR "/home/ubuntu/slam/g2o/cmake_modules") # FindG2O.cmake is in this path
the above error still~ exists .Then I added "/home/ubuntu/slam/g2o/cmake_modules" in CMAKE_MODULE_PATH by : " list(APPEND CMAKE_MODULE_PATH "/home/ubuntu/slam/g2o/cmake_modules") " the above error seems to be solved . but new error as follows emerges :
Building CXX object CMakeFiles/plslam.dir/src/slamScene.cpp.o Building CXX object CMakeFiles/plslam.dir/src/mapFeatures.cpp.o In file included from /home/ubuntu/slam/pl-slam/include/mapHandler.h:27:0, from /home/ubuntu/slam/pl-slam/src/mapHandler.cpp:22: /usr/include/eigen3/Eigen/CholmodSupport:9:23: fatal error: cholmod.h: No such file or directory
^
compilation terminated. In file included from /home/ubuntu/slam/pl-slam/src/voScene.cpp:22:0: /home/ubuntu/slam/pl-slam/include/voScene.h:29:34: fatal error: mrpt/maps/CPointsMap.h: No such file or directory
^
compilation terminated. In file included from /home/ubuntu/slam/pl-slam/include/mapHandler.h:27:0, from /home/ubuntu/slam/pl-slam/include/slamScene.h:43, from /home/ubuntu/slam/pl-slam/src/slamScene.cpp:22: /usr/include/eigen3/Eigen/CholmodSupport:9:23: fatal error: cholmod.h: No such file or directory
so , what's wrong with my operation?
The problem is that at installation of g2o they do not copy the "FindG2O.cmake" into the "/usr/share/cmake-X.X/Modules/" directory. This is where the "find_package" function of cmake usually looks for it. So just copying the "FindG2O.cmake" file there manually solved the problem for me.
@rikpires,have solved the problem,I met the same problem
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ) SET( G2O_ROOT /usr/local/include/g2o ) FIND_PACKAGE( G2O ) i did like it and solved the problem
@lizhihuit can you tell me how to solve this problem.
...
LIST(APPEND CMAKE_MODULE_PATH /home/ubuntu/pl-slam/3rdparty/g2o/cmake_modules) SET(G2O_ROOT /home/ubuntu/pl-slam/3rdparty/g2o) FIND_PACKAGE(G2O REQUIRED)
... ${G2O_INCLUDE_DIR}/3rdparty/g2o/include/
3.Same problems in mrpt, so install mrpt_navigation sudo apt-get install ros-kinetic-mrpt-navigation or sudo apt-get install libmrpt-dev
Enjoy)
you can use set(CMAKE_MODULE_PATH dir) then,cmake will go to this dir to find FIND_XXX.camke or XXXConfig.cmake file.
Create a folder "cmake_modules" next to the "Cmakelist" and put the file "FindG2O.cmake" in the folder. Add this in your cmakelist: list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
FindG2O.cmake: FindG2O .txt Change the suffix to "cmake" (FindG2O.cmake)
When running build.sh, error occurs as follows.