ORB_SLAM2安装

5 篇文章 0 订阅
4 篇文章 0 订阅

进入工程目录,我们发现有两个sh文件,一个是build.sh另一个是build_ros.sh

这两个都可以进行ORB_SLAM2的安装,我们先来看一下build.sh

echo "Configuring and building Thirdparty/DBoW2 ..."

cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j

cd ../../g2o

echo "Configuring and building Thirdparty/g2o ..."

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j

cd ../../../

echo "Uncompress vocabulary ..."

cd Vocabulary
tar -xf ORBvoc.txt.tar.gz
cd ..

echo "Configuring and building ORB_SLAM2 ..."

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j

我们通过查看orb_slam的代码框架可以知道,有2个lib库需要我们编译。一个是DBoW2,另一个是g2o,按照上面的指示可以分别将lib库编译完成。

解压ORBvoc.txt.tar.gz,然后在工程目录下建立build,然后编译,便可以成功。

但是第一次编译,由于没有安装一些依赖,可能会出现以下问题:

//若第一次编译,可能得到以下错误
CMake Error at CMakeLists.txt:40 (find_package):
  By not providing "FindPangolin.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Pangolin",
  but CMake did not find one.

  Could not find a package configuration file provided by "Pangolin" with any
  of the following names:

    PangolinConfig.cmake
    pangolin-config.cmake

  Add the installation prefix of "Pangolin" to CMAKE_PREFIX_PATH or set
  "Pangolin_DIR" to a directory containing one of the above files.  If
  "Pangolin" provides a separate development package or SDK, be sure it has
  been installed.
-- Configuring incomplete, errors occurred!
See also "/home/leonsun/backup/orb_slam2/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
//没有安装Pangolin

解决方法如下:

//到home目录
mkdir Software
cd Software
//下载Pangolin并且编译
git https://github.com/stevenlovegrove/Pangolin.git
//右键提取到此处解压Pangolin文件
cd Pangolin
mkdir build
cd build 
cmake ..

但是得到以下错误

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type not set (defaults to release)
-DCMAKE_BUILD_TYPE=Debug for debug
CMake Error at CMakeModules/FindGLEW.cmake:51 (MESSAGE):
  Could not find GLEW
Call Stack (most recent call first):
  src/CMakeLists.txt:122 (find_package)

没有安装GLEW,利用apt-get进行安装

sudo apt-get install libglew-dev 

重新编译Pangolin,成功。然后按照上部分提供的官网教程进行编译

接着我们来看一下build_ros.sh

echo "Building ROS nodes"

cd Examples/ROS/ORB_SLAM2
mkdir build
cd build
cmake .. -DROS_BUILD_TYPE=Release
make -j

官方给的教程就是运行这个文件进行编译。也可以进行成功编译。


 

  • 6
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值