ubuntu 16 DynSLAM环境配置 编译

1.Clone the repository if you haven't already:
  git clone --recursive https://github.com/AndreiBarsan/DynSLAM
  **Some files(submodule) under the src dir need to be downloaded by yourself.**
  **eigen3 can be download from the 'Eigen website'**
  
2.Download opencv 2.4.9; cmake&make it; 
If you have installed e.g. opencv 3 previous, you should change sth in the CMakeLists
find_package(OpenCV REQUIRED) -> find_package(OpenCV 2 REQUIRED) 
This makes your project to know which version of opencv you'd like to use

3.Pangolin

4.Cuda 8
4.1 NVIDIA driver
  - Independencies 
  ``sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler  --no-install-recommends libboost-all-dev  libopenblas-dev liblapack-dev libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev

  - https://www.nvidia.cn/Download/index.aspx?lang=cn 
    Download according to your environment.
    
    
  - Drag the download under the 'Home' dir.
  
  - clean all files relates to Nvidia
    sudo apt-get --purge remove nvidia-*
    sudo apt autoremove
  
  
  - shut down graphic interface
    sudo /etc/init.d/lightdm stop
    
    press alt+ctrl+f1 
    
  - Install driver
    sudo chmod  a+x NVIDIA-Linux-x86_64-410.78.run  #adjust to your own file
    sudo ./NVIDIA-Linux-x86_64-410.78.run -no-x-check -no-nouveau-check -no-opengl-files
    
    Select Continue, yes, ok
    
    Error: kernel blabla fail. 
    Reason: install linus using UEFI.  Disable the Secure Boot in bios
    
    reinstall
    
    Then, Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver ...
    Select Yes
    
    
    check whether install successfully
    cat /proc/driver/nvidia/version  
    OR
    sudo nvidia-smi

   start graphic interface
   sudo /etc/init.d/lightdm start\
   
4.2 Install Cuda 8.0
   download cuda 8.0 tool kit CUDA Toolkit 8.0 (download .runfile)
   
   install:
   sudo sh cuda_8.0.61_375.26_linux.run 
   
   Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
   no, we have installed one.
   
   Install the CUDA 8.0 Toolkit?
   yes
   
   else yes
   
   sudo gedit ~/.bashrc
   
   add
   export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
   export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
   at the end.
   
   source ~/.bashrc

   test:
   nvcc --version
   
 4.3 install cuda samples.
   sudo apt-get install freeglut3 freeglut3-dev
   cd ~/NVIDIA_CUDA-8.0_Samples/common
   gedit findgllib.mk
   change [UBUNTU_PKG_NAME = "nvidia-418"] according to your driver version, save
   cd ~/NVIDIA_CUDA-8.0_Samples  
   make -j12 
   
   cd bin/x86_64/linux/release/  
   test: ./deviceQuery      
   

5. install nvidia-docker2
   sudo apt-get update
   sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
   
   curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
   
   sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
   
   sudo apt-get -y update
   sudo apt-get -y install docker-ce
   
   sudo groupadd docker
   sudo gpasswd -a $USER docker
   newgrp docker
   docker ps
   docker version
   
   docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
   sudo apt-get purge -y nvidia-docker
   sudo apt autoremove
   
   curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
        sudo apt-key add -
        
   distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
   
   curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
   sudo tee /etc/apt/sources.list.d/nvidia-docker.list

   sudo apt-get update
   
   sudo apt-get install -y nvidia-docker2
   sudo pkill -SIGHUP dockerd
  
   test:sudo docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
   
   
   
6.Install the prerequisites (Ubuntu example):
sudo apt-get install libxmu-dev libxi-dev freeglut3 freeglut3-dev glew-utils libglew-dev libglew-dbg libpthread-stubs0-dev binutils-dev libgflags-dev libpng++-dev libeigen3-dev
 
7.build DynSLAM project
mkdir build && cd build && cmake .. && make -j$(nproc)

error:
- 1.error: ‘setw’ was not declared in this scope 
sol: add #include <iomanip>

- 2.error: ‘resize’ is not a member of ‘cv’
  ‘cvtColor’ is not a member of ‘cv’ 
  ‘putText’ is not a member of ‘cv’ 
sol:add #include "opencv2/imgproc/imgproc.hpp"
        #include "opencv2/opencv.hpp"

- 3.error nvcc fatal   : redefinition of argument 'std'
find the location of the file showing this error.  Modify the cmakelist to delete -std=c++11 (may also need modify the CMakeLists.txt of DynSLAM)
do 
cmake ..
make

- 4.error: ‘imread’ is not a member of ‘cv’
sol:#include "opencv2/imgproc/imgproc.hpp"
    #include "opencv2/opencv.hpp"

- 5.error: ‘glDrawFrustrum’ is not a member of ‘pangolin’
  pangolin API change name glDrawFrustrum to glDrawFrustum
  just find the function and change it.
  
  Now everything works fine!!!!!
  
  
8.test DynSLAM
  - 1. Download the demo sequence 
  https://drive.google.com/uc?export=download&confirm=Nnbd&id=1V-I4Tle7MNbmnf2qRe6aTpjxOld2M2i8
  
  - 2.Extract that to a directory, and run DynSLAM on it (the mkdir circumvents a silly bug): 
  make a csv file in the root dir of the project:mkdir -p csv 
  then run:
  ./build/DynSLAMGUI --use_dispnet --dataset_root=path/to/extracted/archive --dataset_type=kitti-odometry
  e.g. ./build/DynSLAMGUI --use_dispnet --dataset_root=mini-seq-06 --dataset_type=kitti-odometry

 

 

## Environment setting: MNC:

https://github.com/mounchiliu/EverythingAboutSLAM/blob/master/Tip2_DynSLAM

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值