ubuntu18.04安装g2o
  3X8QcYBeJJMW 2023年11月13日 26 0

先对g2o的依赖库进行安装:

sudo apt-get update
sudo apt-get install libeigen3-dev
sudo apt-get install libsuitesparse-dev
sudo apt-get install qtdeclarative5-dev
sudo apt-get install qt5-qmake
sudo apt-get install libqglviewer-dev-qt5

然后下载g2o(2020那个版本)

地址:https://github.com/RainerKuemmerle/g2o/tree/20200410_git

然后在解压后的g2o文件目录下输入:

mkdir build
cd build
sudo ldconfig
cmake ..
make j2

CMakeLists.txt引用g2o:

LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ) 
SET( G2O_ROOT /usr/local/include/g2o ) 
find_package(G2O REQUIRED)
include_directories(${G2O_INCLUDE_DIRS})
add_executable(g2oCurveFitting g2oCurveFitting.cpp)
target_link_libraries(g2oCurveFitting g2o_core g2o_stuff ${OpenCV_LIBS})

之后编译时出现下面问题

Please set them or make sure they are set and tested correctly in the CMake files: G2O_INCLUDE_DIRS    

used as include directory in directory /home/xj/slambook2-master/ch6    

used as include directory in directory /home/xj/slambook2-master/ch6    

used as include directory in directory /home/xj/slambook2-master/ch6

是因为cmake_modules写成了cmake_module

其它链接:Ubuntu16.04安装视觉SLAM环境(g2o)


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
3X8QcYBeJJMW