Isaac's Blog

RAPter on Ubuntu

2018/04/29

The RAPter gives us a very nice design and implementation for doing man-made scene reconstruction. According to the nature of its algorithm, it also shows a potential use in terms of 3D plane detection. However, the documentation related to it is pretty poor, so I decide to write here a summary of how to install it on Ubuntu 16.04 LTS.

Workspace

The first thing is to create a workspace directory in user’s home directory and a 3rdparty subdirectory under workspace. Thus we can define the workspace path WORKSPACE_DIR as $ENV{HOME}/workspace and the third party dependencies path THIRD_PARTY_DIR as ${WORKSPACE_DIR}/3rdparty. In the following steps, we will store all the implementations of RAPter tools and experimental data in workspace and download all the dependencies in 3rdparty.

Dependencies

RAPter requires several dependencies, including OpenCV, PointCloudLibrary, CoinBonmin and libfbi. Prior to downloading and installing all these dependences, we need to first get prepared with a few tools, including Git, SVN and CMake via the following commands.

1
2
3
4
sudo apt-get update
sudo apt-get install git
sudo apt-get install subversion
sudo apt-get install cmake

OpenCV

To install the latest version of OpenCV, we can use the installation script install-opencv.sh. We first download this script in the 3rdparty directory and then execute:

1
bash install-opencv.sh

Type the sudo password and OpenCV will be installed.

PointCloudLibrary

There is no ready-made script for PointCloudLibrary, so the installation of it could be a bit tedious.

Setup Prerequisites

The PointCloudLibrary also needs a bunch of prerequisite tools. We use the commands below to have them setup.

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo apt-get install git build-essential linux-libc-dev
sudo apt-get install cmake cmake-gui
sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev
sudo apt-get install mpi-default-dev openmpi-bin openmpi-common
sudo apt-get install libflann1.8 libflann-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libvtk5.10-qt4 libvtk5.10 libvtk5-dev
sudo apt-get install libqhull* libgtest-dev
sudo apt-get install freeglut3-dev pkg-config
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install mono-complete
sudo apt-get install qt-sdk openjdk-8-jdk openjdk-8-jre

Build PointCloudLibrary

In the 3rdparty directory, PointCloudLibrary is obtained by:

1
git clone https://github.com/PointCloudLibrary/pcl.git

Now we get into pcl, create a release directory in it, and then follow the cmake build process.

1
2
3
4
5
6
7
cd pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON \
-DCMAKE_INSTALL_PREFIX=/usr ..
make

Once the build is finished, we install it by:

1
make install

CoinBonmin

As usual, we need to intall the prerequisites:

1
2
3
sudo apt-get install liblapack-dev
sudo apt-get install libblas-dev
sudo apt-get install fortran-compiler

Then we download CoinBonmin in 3rdparty:

1
svn co https://projects.coin-or.org/svn/Bonmin/stable/1.5 CoinBonmin-stable

CoinBonmin also requires a third party solver. To get it, we have to first go to the directory CoinBonmin-stable/ThirdParty/Mumps and run:

1
./get.Mumps

To compile and install CoinBonmin, we have to go back to the root directory of it, which is CoinBonmin-stable, and create a build directory in it, then run the cmake process.

1
2
3
4
5
mkdir build
cd build
../configure -C
make
make install

libfbi

We only have to download libfbi in 3rdparty, no prerequisites or installation is required.

1
git clone https://github.com/mkirchner/libfbi.git

Compilation

Finally, all the dependencies are satisfied. We first get the RAPter in the workspace directory:

1
git clone https://github.com/amonszpart/RAPter.git

Then get into the root of Rapter, which is RAPter/RAPter, and build it.

1
2
3
4
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Besides, we may also need to change the default directories of dependencies in CMakelist.txt. For example, following this article, the directory of PointCloudLibrary PCL_DIR should be ${THIRD_PARTY_DIR}/pcl/ instead of ${THIRD_PARTY_DIR}/pcl-trunk2/install/share/pcl-1.8/.

CATALOG
  1. 1. Workspace
  2. 2. Dependencies
    1. 2.1. OpenCV
    2. 2.2. PointCloudLibrary
      1. 2.2.1. Setup Prerequisites
      2. 2.2.2. Build PointCloudLibrary
    3. 2.3. CoinBonmin
    4. 2.4. libfbi
  3. 3. Compilation