我在編譯程序中主要參考了以下幾篇博客:
Ubuntu16.04編譯高博的ORBSLAM2_with_pointcloud_map_Andyoyo007的博客-CSDN博客編譯高博ORBSLAM2_with_pointcloud_map,用TUM資料集測驗,_Seven的博客-CSDN博客
編譯安裝高翔的ORBSLAM2_with_pointcloud_map,獲取點云地圖_站在巨人的肩膀上coding-CSDN博客_高翔orbslam2
1、下載源代碼
git clone https://github.com/gaoxiang12/ORBSLAM2_with_pointcloud_map.git
2、將其中的壓縮包解壓,將壓縮包中的ORB_SLAM2_modified用原來的根目錄下的ORB_SLAM2_modified來代替,
3、編譯安裝g20_with_orbslam2并對一些常見的錯誤進行處理
1) 修改 g2o_with_orbslam2/CMakeLists.txt ,注釋如下代碼:

2)修改 2)g2o_with_orbslam2/g2o/CMakeLists.txt ,注釋如下代碼:

3)報錯1

解決:修改 g2o_with_orbslam2/g2o/types/slam2d/edge_se2_pointxy_bearing.cpp
將
t.setRotation(t.rotation().angle()+_measurement);
改為
t.setRotation((Eigen::Rotation2Dd)(t.rotation().angle()+_measurement));
4)報錯

解決:修改g2o_with_orbslam2/g2o/solvers/eigen/linear_solver_eigen.h(注意:eigen3.2.8不用修改此處,以上版本需修改,如3.3.7) 我的eigen版本 3.3.7 ,
將
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
改為
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::StorageIndex> PermutationMatrix;
5)安裝成功

4、編譯ORB_SLAM2_modified
暫時還沒有編譯出來hh
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/302601.html
標籤:其他
