ubuntu16.04 运行DynaSLAM

#####仅作为笔记

  1. ORBSLAM2
    https://github.com/raulmur/ORB_SLAM2
    (1) Pangolin
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
sudo apt install libpython2.7-dev
sudo apt-get install freeglut3-dev
sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
sudo apt-get install build-essential
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make -j4
sudo make install

(2) OpenCV

sudo apt-get install libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 
https://github.com/opencv/opencv/releases  下载对应版本
tar -xzvf opencv-3.x.0.tar.gz
cd opencv-3.x.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 
make -j4
sudo make install

(3) Eigen

sudo apt-get install libeigen3-dev

(4)安装

cd ~catkin_ws/src
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
或者需要ros版本的
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/SLAM/src/ORB_SLAM2/Examples/ROS
./build_ros.sh
  1. Mask_RCNN
#安装TensorFlow和Keras
pip install tensorflow==1.3.0
pip install keras==2.0.8
pip install numpy==1.15.2

#安装Mask_RCNN:
git clone https://github.com/matterport/Mask_RCNN.git
cd Mask_RCNN-master
sudo pip install -r requirements.txt
sudo python2 setup.py install

#安装pycocotools:
git clone https://github.com/waleedka/coco.git
cd coco-master/PythonAPI
sudo make install

这里注意要下载含carla的branch,作者的cmakelists中包含了carla的编译配置,然而在master中删去了carla的源文件,不然编译会报错。
https://github.com/BertaBescos/DynaSLAM/tree/bbescos/feature/carla
下载mask_rcnn_coco.h5权重:https://github.com/matterport/Mask_RCNN/releases

将coco/PythonAPI下的pycocotools文件夹和mask_rcnn_coco.h5放到Dynaslam的src/python目录下。打开Check.py,将第17行的ROOT_DIR = “src/python”,改为ROOT_DIR = “./”,保存退出。
运行:

python Check.py
#检查MaskRCNN环境配置

安装:

git clone https://github.com/BertaBescos/DynaSLAM.git
cd DynaSLAM
chmod +x build.sh
./build.sh

测试:

./Examples/Stereo/stereo_kitti Vocabulary/ORBvoc.txt Examples/Stereo/KITTIX.yaml PATH_TO_DATASET_FOLDER/dataset/sequences/SEQUENCE_NUMBER (PATH_TO_MASKS)
或者:
python associate.py PATH_TO_SEQUENCE/rgb.txt PATH_TO_SEQUENCE/depth.txt > associations.txt
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUMX.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS_FILE (PATH_TO_MASKS) (PATH_TO_OUTPUT)

测试结果:
ubuntu16.04 运行DynaSLAM_第1张图片ubuntu16.04 运行DynaSLAM_第2张图片

你可能感兴趣的:(SLAM,slam)