Skip to content

Installation

Saurav Agarwal edited this page Oct 2, 2023 · 1 revision

Common setup

Workspace directory: ${HOME}/CoverageControl_ws.
Add the following lines to your ${HOME}/.bashrc file and then source ${HOME}/.bashrc or open a new terminal:

export COVERAGECONTROL_WS=${HOME}/CoverageControl_ws/

Clone the repository:

mkdir -p ${COVERAGECONTROL_WS}/src
git clone https://github.com/KumarRobotics/CoverageControl.git ${COVERAGECONTROL_WS}/src/CoverageControl

We have two options: (1) Local install, or (2) Docker

Local Install

Tested on Ubuntu 22.04 and 20.04.
Install latest cmake

We will need to add the path to LD_LIBRARY_PATH in ${HOME}/.bashrc. Also, we will need to provide an environment variable for cmake. Add the following lines to your .bashrc file and then source ~/.bashrc or open a new terminal:

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COVERAGECONTROL_WS}/install/CoverageControl/lib/
export CoverageControlCore_DIR=${COVERAGECONTROL_WS}/install/CoverageControl/
export GeographicLib_DIR=${COVERAGECONTROL_WS}/install/CoverageControl/lib/cmake/GeographicLib/

We will store build files in ${COVERAGECONTROL_WS}/build and install files in ${COVERAGECONTROL_WS}/install/CoverageControl.

cd ${COVERAGECONTROL_WS}/src/CoverageControl
bash install/install_dependencies.sh ${COVERAGECONTROL_WS}/install/CoverageControl  
bash setup.sh -i -d ${COVERAGECONTROL_WS}

Try:

cd ${COVERAGECONTROL_WS}  
./install/CoverageControl/bin/coverage_algorithm

We can build python bindings by simply adding -p flag.

bash setup.sh -ip -d ${COVERAGECONTROL_WS}
python src/CoverageControl/python/tests/coverage_algorithm.py

LibTorch extensions

The library provides libtorch extensions for using machine learning models within C++:

cd ${COVERAGECONTROL_WS}/src/CoverageControl
bash install/install_libtorch.sh ${HOME}/opt

Add the following lines to your .bashrc file and then source ~/.bashrc or open a new terminal:

export Torch_DIR=${HOME}/opt/libtorch/

We can build libtorch bindings by adding -t flag.

bash setup.sh -ipt -d ${COVERAGECONTROL_WS}

Docker

Coverage control uses GPU for creating maps. You will need to add Nvidia capability to docker.
nvida container toolkit

Download the image and create a container:

bash ${COVERAGECONTROL_WS}/src/CoverageControl/install/docker/create_gpu_container.sh ${COVERAGECONTROL_WS}

This will download the image gnn and create a container gnn-${USER}.
The first time, you will be placed in a bash terminal. Exit it using Ctrl + D.
Start the container using the following command:

docker start gnn-$USER

Execute the following whenever you want to get inside the container terminal:

docker exec -it gnn-$USER bash

Install the library:

bash src/CoverageControl/setup.sh -ipt

If you want build directory to persist for development:

bash src/CoverageControl/setup.sh -iptg ${COVERAGECONTROL_WS}

Try:

python src/CoverageControl/python/tests/coverage_algorithm.py
Clone this wiki locally