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.

## 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:

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.

### Build PointCloudLibrary

In the 3rdparty directory, PointCloudLibrary is obtained by:

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

Once the build is finished, we install it by:

## CoinBonmin

As usual, we need to intall the prerequisites:

Then we download CoinBonmin in 3rdparty:

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

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.

## libfbi

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

# Compilation

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

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

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/.