Compiling Google Cartographer

How to compile Google cartographer on ROS on OcPoC

Google recently released its open-source solution for indoor mapping. This tutorial shows how to get the software downloaded and installed on OcPoC. Check out their webpage to find out more, and to see a list of hardware you'll need.

https://google-cartographer.readthedocs.io

Download and Install Cartographer

First, make sure you have followed our tutorials on getting Ubuntu and ROS installed on OcPoC. Once you have ROS configured and installed, you may continue.

Also you will need to enable swap memory in your system. If you haven't done that yet, follow the Create Swap Memory tutorial.

Note that these directions are pulled directly from Google's tutorial.

Make sure you're connected to the internet, either via ethernet or WiFi. Once this is accomplished, update your system. In your serial console, type:

$ apt-get update
$ sudo apt-get install -y python-wstool python-rosdep ninja-build

Once the tools are downloaded, set up your ROS workspace as directed below:

$ mkdir catkin_ws
$ cd catkin_ws
$ wstool init src

Merge cartographer and download the files.

$ wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
$ wstool update -t src

Next, install dependencies.

$ rosdep update
$ rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

This will take a few moments. When this is done, you will build and install Cartographer. This can take up to a couple hours.

$ catkin_make_isolated --install --use-ninja
$ source install_isolated/setup.bash

When it completes, you now have Cartographer installed and ready to use on OcPoC! For questions on how to use it, refer to Google's webpage.