mp3guy / Kintinuous

Real-time large scale dense visual SLAM system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update Build.sh to support Ubuntu 16.04

austinchambers opened this issue · comments

I've followed the Ubuntu 16.04 steps from the documentation and I've attempted to build Kintinuous, but the build.sh file fails with: "Don't use this on anything except 14.04 or 15.04"

Are there additional steps required (or steps omitted) to get this working in 16.04? If so, I'm happy to create a new version of the build.sh file that performs those steps and verify on a fresh 16.04 instance.

I already modified my own bash script for installation, but haven't have change to test on other machine.

The major modification is I do not install OpenCV into system lib directory, because it's easily been affect by other program setting.

(1) Create dep_cmake folder

(https://www.dropbox.com/s/g60xbgij710n93d/cmake.zip?dl=0)
Modify the folder name of above zip to dep_cmake, and place it to project root.
The files provided added opencv search related code.

set(OpenCV_DIR $ENV{OpenCV_DIR249})
INCLUDE_DIRECTORIES($ENV{OpenCV_DIR249}/include)
set(OpenCV_INCLUDE_DIRS $ENV{OpenCV_DIR249}/include)
set(OpenCV_LIBS $ENV{OpenCV_DIR249}/lib)

FIND_PACKAGE( OpenCV REQUIRED )

(2) Define env variable of OpenCV

You should define OpenCV_DIR249 env variable before running script.

export OpenCV_DIR249={project root}/deps/opencv-2.4.9/build/installed 

This could be writing into script.

(3) Run installation script.

#!/bin/bash

mkdir deps
cd deps

#Add necessary extra repos
version=$(lsb_release -a 2>&1)
sudo apt-get update

sudo apt-get install -y cmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-8-jdk freeglut3-dev python-vtk libvtk-java libglew-dev libsuitesparse-dev openexr

#PCL
sudo apt-get install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann-dev libeigen3-dev libboost-all-dev libvtk5-qt4-dev libvtk6.2 libvtk5-dev libqhull* libusb-dev libgtest-dev git-core freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphviz mono-complete qt-sdk openjdk-8-jdk openjdk-8-jre
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_GPU=OFF -DBUILD_apps=OFF -DBUILD_examples=OFF ..
make -j4
sudo make install
sudo ldconfig
cd ../..


#Installing Pangolin
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
git reset --hard 66df6eab2b456592884a53e7fc2805e8c2491fea
mkdir build
cd build
cmake ../ -DAVFORMAT_INCLUDE_DIR=""
make -j4
sudo make install
cd ../..

#Up to date OpenNI2 only included in the 14.04 PCL PPA
git clone https://github.com/occipital/OpenNI2.git
cd OpenNI2
make -j4
cd ..

#15.04 needs ffmpeg to stop OpenCVs build dying, otherwise DBoW won't build (which also won't build with OpenCV3, hurray dependencies!)
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg/
git reset --hard cee7acfcfc1bc806044ff35ff7ec7b64528f99b1
./configure --enable-shared
make -j4
sudo make install
sudo ldconfig
cd ..
rm -rf ffmpeg

#Building OpenCV from scratch without Qt and with nonfree
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9.zip
rm opencv-2.4.9.zip
cd opencv-2.4.9
mkdir build
cd build
mkdir installed
cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF -D WITH_OPENCL=OFF -D WITH_OPENMP=ON -D INSTALL_C_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D WITH_QT=OFF -D WITH_OPENGL=OFF -D WITH_VTK=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -DCMAKE_INSTALL_PREFIX=./installed ..
make -j4
sudo make install
cd ../..



#DLib for place recognition
git clone https://github.com/dorian3d/DLib.git
cd DLib
git reset --hard 330bdc10576f6bcb55e0bd85cd5296f39ba8811a
cp ../../dep_cmake/CMakeLists.txt_DLib ./CMakeLists.txt
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
rm -rf DLib

#DBoW2 for place recognition
git clone https://github.com/dorian3d/DBoW2.git
cd DBoW2
git reset --hard 4a6eed2b3ae35ed6837c8ba226b55b30faaf419d
cp ../../dep_cmake/CMakeLists.txt_DBoW2 ./CMakeLists.txt
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
rm -rf DBoW2

#DLoopDetector for place recognition
git clone https://github.com/dorian3d/DLoopDetector.git
cd DLoopDetector
git reset --hard 84bfc56320371bed97cab8aad3aa9561ca931d3f
cp ../../dep_cmake/CMakeLists.txt_DLoopDetector ./CMakeLists.txt
mkdir build
cd build
cmake ../
make -j4
sudo make install
cd ../..
rm -rf DLoopDetector

#iSAM for pose graph optimisation
wget http://people.csail.mit.edu/kaess/isam/isam_v1_7.tgz
tar -xvf isam_v1_7.tgz
rm isam_v1_7.tgz
cd isam_v1_7
mkdir build
cd build
cmake ..
make -j4
sudo make install
cd ../..
rm -rf isam_v1_7

#Actually build Kintinuous
cd ..
mkdir build
cd build
cp ../dep_cmake/CMakeLists.txt ../src
cmake ../src
make -j4

@austinchambers You could use my configuration as reference, and merge build script to previous version of Ubuntu.

This is fantastic, thanks so much! I'll read the guide on your link, give the above a shot, and get back to you soon with results.

@HTLife: I attempted to follow the above guide, but I'm not sure it's quite right. After trying a few installs from existing Ubuntu and having no success, I've been trying fresh installs of 14.04, 15.04, and 16.04 and having no luck.

Accordingly, I would expect that the OpenCV installation would take place prior to setting the environment variables for it, right? Just to confirm, are you expecting a fresh 16.04 installation in the above guide (i.e., no OpenCV installed)?

@austinchambers
The script should work even with pre-installed OpenCV.

The purpose of my script is to install the whole system without interference by existing libraries. Therefore, I set the cmake parameter of OpenCV with install path. And set other dependency lib to use that path.

What's the error message of 16.04?

@HTLife Please can you share the dep_cmake folder! the dropbox link is dead! i know this is very old! but i was trying to install it and failed at last stop! i didnt have the folder! thanks

@qaisarehman I don't have that file anymore.
However, you can install the OpenCV into the system folder.
Then you are good to follow the remaining steps.

@qaisarehman I don't have that file anymore.
However, you can install the OpenCV into the system folder.
Then you are good to follow the remaining steps.

Thanks for the reply! :) im tool noob here! i actually dont know how to use ubuntu! but anyway! ill try to figure this out! :P I managed to build elasticfusion! now trying this!!

did you used xbox Kinect v1 with ElasticFusion! please if you can guide me to setup Kinect v1!? any guide line will be great! thanks