安装必备软件:
(1)更新apt库
sudo apt-get update
(2)安装git
sudo apt-get install git
(3)安装cmake
sudo apt-get install cmake
(4)安装Eigen 3.2
下载Eigen下载地址(http://eigen.tuxfamily.org/index.php?title=Main_Page),进入到在解压后的Eigen文件夹(例如eigen-eigen-07105f7124f9)下
mkdir build
cd build
cmake ..
make
sudo make install
(5)安装Pangolin(https://github.com/stevenlovegrove/Pangolin)
(6)安装BLAS and LAPACK库
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
3.安装ORB_SLAM:
(1)Clone the repository:
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
(2)编译:
cd ORB_SLAM2
chmod +x build.sh
常见问题解决:
error: ‘usleep’ was not declared in this scope usleep(3000);
需要打开相应的代码,在Frame.h头文件里面添加usleep 的头文件unistd.h
,问题就解决了!
ubuntu16.04编译ORBSLAM2问题解决
在编译ubuntu16.04ros包的时候出现以下问题
出错原因为:libboost_system.so 与libboost_filesystem.so找不到链接目录
- 解决方案为查找所在目录
locate boost_system
locate boost_filesystem
将libboost_system.so与libboost_filesystem.so复制到ORB_SLAM2/lib下,并且将ORBSLAM2/Examples/ROS/ORBSLAM2下的Cmakelists.txt中加入库目录,具体在
set(LIBS
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
)
后面追加
${PROJECT_SOURCE_DIR}/../../../lib/libboost_filesystem.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_system.so
问题得以解决