ubuntu18安装ORBSLAM1

  • Post author:
  • Post category:其他


首先需要注意的是,本文编译的ORBSLAM1不是ORBSLAM2。

按照官方流程来。先添加ROS环境变量,然后分别在第三方文件下编译好各个库

然后进行编译。

depends on non-existent package 'opencv2' and rosdep claims that it is not a

文档中也有说,将manifest.xml中的 注释掉。

: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY

这里是eigen的问题。修改我们前面第三方库里的g2o

class LinearSolverEigen: public LinearSolver<MatrixType>
 {
   public:
     typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
     typedef Eigen::Triplet<double> Triplet;
     typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;

改为

 class LinearSolverEigen: public LinearSolver<MatrixType>
 {
   public:
     typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
     typedef Eigen::Triplet<double> Triplet;
     typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;

[ 36%] Linking CXX executable ../bin/orb_ws
/usr/bin/ld: CMakeFiles/orb_ws.dir/src/main.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/orb_ws.dir/build.make:1587: recipe for target '../bin/orb_ws' failed
make[2]: *** [../bin/orb_ws] Error 1
CMakeFiles/Makefile2:643: recipe for target 'CMakeFiles/orb_ws.dir/all' failed
make[1]: *** [CMakeFiles/orb_ws.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

这里是没有链接上boost ,在cmakelists如下修改

find_package(Boost COMPONENTS system filesystem REQUIRED)
target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
${Boost_LIBRARIES}
)

最后可以跑数据集了


TUM数据集


附加一份参考博客,内涵运行命令。


ORBSLAM1



reference


opencv部分



修改g20



版权声明:本文为weixin_44916682原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。