Ubuntu16.04 deployment DynaSLAM

DynaSLAM is an article published in IROS in 2018, and the code is currently open source. This article removes the dynamic objects in the environment very well and restores the environment structure. This article mainly records some problems I encountered when configuring and running the source code of this article, hoping to help everyone.

The configuration of my computer is ubuntu16.04+numpy1.15.2+python2.7, and the detailed configuration is introduced below.

1. Configure ORB-SLAM2

The configuration of ORB-SLAM2 is relatively simple, you can directly configure it through the introduction of ORB-SLAM2 homepage .

2. Configure Mask_RCNN

The Mask_RCNN homepage requires the use of Python3.4+TensorFlow1.3+Keras2.0.8, but DynaSLAM uses Python2.7 (I use Python3.5 to configure and run, and the PyImport_ImportModule() function returns NULL, which has not been resolved), so use Python2 .7 Configure Mask_RCNN.

Python2.7 installation

Install TensorFlow and Keras (install first to avoid subsequent uninstall and reinstall):

sudo pip2 install tensorflow==1.3.0
sudo pip2 install keras==2.0.8
sudo pip2 install numpy==1.15.2

Install the package in requirements.txt:

git clone https://github.com/matterport/Mask_RCNN.git
cd Mask_RCNN-master
sudo pip2 install -r requirements.txt

Execute the setup.py file:

sudo python2 setup.py install

Install pycocotools:

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

Python3 installation (error running DynaSLAM after installation)

Install TensorFlow and Keras (install first to avoid subsequent uninstall and reinstall):

sudo pip3 install tensorflow==1.3.0
sudo pip3 install keras==2.0.8
sudo pip3 install scipy==1.2.1

Install the package in requirements.txt:

git clone https://github.com/matterport/Mask_RCNN.git
cd Mask_RCNN-master
sudo pip3 install -r requirements.txt

Execute the setup.py file:

sudo python3 setup.py install

Install pycocotools:

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

3. Run DynaSLAM

Download the pre-trained COCO model weight mask_rcnn_coco.h5 , put it in the DynaSLAM/src/python directory, and compile DynaSLAM:

chmod +x build.sh
./build.sh

After the compilation is complete, run the corresponding data set according to the instructions on the DynaSLAM homepage .

4. Problems encountered during configuration

1. After using Python3 to configure the dependency package, an error occurs when running DynaSLAM, and the PyImport_ImportModule() function returns NULL. It works fine with Python2.7.
2. If fatal error is encountered during compilation, change CMakeLists.txt:

将CMakeLists.txt中
${Pangolin_INCLUDE_DIRS}
/usr/include/python2.7/
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/
改为
${Pangolin_INCLUDE_DIRS}
/usr/include/python2.7/
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/

3. In the DynaSLAM source code, some python files mix tabs and spaces and some indentation mismatches appear in the function definitions, resulting in compilation errors, which need to be changed by yourself. The modified file has been uploaded to CSDN, and those who need it can download it here
4. When running MaskRCNN, it is very likely that an error message will be reported:

ImportError: No module named _tkinter, please install the python-tk package

Whether you configure python3 or configure python2, you may encounter this problem, just install the corresponding package

sudo apt-get install python-tk  #(python2)
sudo apt-get install python3-tk  #(python3)

Guess you like

Origin blog.csdn.net/qq_42938987/article/details/83795217