How to map large indoor spaces with Google Cartographer

warehouse mapped with a LiDAR scanner

A large warehouse partially mapped with cartographer

When you need to navigate in an indoor environment, you won’t have access to GPS satellites to get your location, and you’ll need to rely on other solutions to know your location. Above all, you will need a software framework that captures the environment and builds a maps out of all possible sensor data. This article focuses on the most popular mapping software at this time of writing: Cartographer.

What is Cartographer and how does it work

Cartographer is a real-time simultaneous localization and mapping (SLAM) software designed to create high-resolution, 2D and 3D maps of indoor and outdoor environments.

point cloud generated from a 3D lidar scan

It uses a combination of sensors including lasers, cameras, wheel odometry and Inertial Measurement Units (IMU), as well as advanced algorithms such as scan matching and graph optimization, to build an accurate map of the environment in real time. While it is primarily aimed at mapping applications, Google's SLAM technology can be used in many areas such as robot navigation and mobile point cloud creation. In addition to accumulating real-world data points in real-time, the system is also able to take maps generated elsewhere—such as CAD models—and use them to construct environments more quickly than using real-world measurements alone. Cartographer has become an essential part of exploring real-world environments with robots or other machines.

Availability of the Cartographer Software

Cartographer is open-source software that was introduced by Google in 2016 and is now maintained by Open Robotics. The reference to Google is dropped nowadays, but often added to refer to this specific SLAM package. It is available as a ROS (Robot Operating System) package and is hosted on GitHub, making it easy for developers to integrate into existing robotics systems. The latest Cartographer release is version 2.0.0 and the software repository is mainly in maintenance mode.


How to setup Cartographer to map a large indoor space

Creating an accurate map of a large indoor space such as a warehouse or factory using Cartographer is an achievable task, but one that requires careful planning and design. To create a high-quality map, three major points of attention must be checked:

  1. the LIDAR sensor range must be made proportional to the enclosed area.
  2. the sensor's positioning needs make sure that the LIDAR beams can access distinctive areas of the environment.
  3. use the IMU and wheel odometry in the predictive step to make sure LIDAR points are accurately associated with the correct location in three-dimensional space.

For this to work properly, calibration of the LIDAR sensor with respect to the wheels and IMUs will ensure correct matching of points between scans.

With these factors in mind, it is possible to create a detailed 3D map of any large indoor space quickly using Cartographer.

Optimizing and Tuning Cartographer maps

For those looking to optimize and tune their maps, there are a few tips that can help ensure success. Firstly, be aware of thin walls that are squeezed to one 2D line or 3D surface, as these can lead to bends in the map. Furthermore, tune the parameters of loop closure searching in submaps so that it is not too rigorous – otherwise you won't get a complete map – nor too relaxed – otherwise the poses won't match up sufficiently. If done properly, then using Google Cartographer can quickly produce dependable maps.

How to get started with Cartographer

Cartographer is a robust and powerful standalone C++ library, designed to make mapping and navigation easy and efficient. But if you don't want the hassle of setting up Cartographer yourself, there are packages which integrate Cartographer with Robot Operating System (ROS) available. For ROS 1 users, Noetic is the preferred release; if you're running ROS 2, there's also a package available for the Humble release.

If you need additional support, our team at Intermodalics would be happy to provide assistance. Contact us today to get started!

Order Cartographer Support

Discover Our Expertise

Visual SLAM and Cartographer

We are slam experts, developing, contributing and integrating proprietary and Open Source libraries (like Cartographer, ORBSlam,…) for Visual SLAM, laser-based SLAM, 2D and 3D based SLAM.

Read Visual SLAM and Cartographer

Mobile Robot Navigation

We create and/or tune 2D, 3D and 6D motion planners for robots using Open Source and custom developed software.

Read Mobile Robot Navigation

ROS 2 Integration

We develop pure ROS 2 applications, as well as hybrid setups for ROS 1 and ROS 2.

Read ROS 2 Integration