Convert Figma logo to code with AI

cartographer-project logocartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.

7,089
2,247
7,089
231

Top Related Projects

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.

2,713

RTAB-Map library and standalone application

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

3D LIDAR-based Graph SLAM

Quick Overview

Cartographer is an open-source system for real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations. It is developed by Google and provides a flexible and efficient solution for robotics and autonomous systems to create maps of their environment while simultaneously determining their location within it.

Pros

  • High performance and real-time operation
  • Supports both 2D and 3D SLAM
  • Flexible and adaptable to various sensor configurations
  • Well-documented and actively maintained by Google

Cons

  • Steep learning curve for beginners
  • Requires careful tuning of parameters for optimal performance
  • Limited support for loop closure in certain scenarios
  • Resource-intensive for large-scale mapping tasks

Code Examples

  1. Initializing a 2D SLAM node:
#include "cartographer/mapping/map_builder.h"
#include "cartographer/sensor/range_data.h"

auto map_builder = cartographer::mapping::CreateMapBuilder(options);
auto trajectory_builder = map_builder->AddTrajectoryBuilder(
    {sensor_id}, trajectory_options, nullptr);
  1. Adding sensor data to the SLAM system:
sensor::TimedPointCloudData point_cloud;
// ... populate point_cloud with sensor data
trajectory_builder->AddSensorData(sensor_id, point_cloud);
  1. Retrieving the current pose estimate:
auto pose_estimate = trajectory_builder->pose_estimate();
if (pose_estimate.has_value()) {
    const auto& pose = pose_estimate.value().pose;
    std::cout << "Current pose: " << pose << std::endl;
}

Getting Started

To get started with Cartographer:

  1. Install dependencies:
sudo apt-get install -y google-mock libboost-all-dev libeigen3-dev libgflags-dev libgoogle-glog-dev liblua5.2-dev libprotobuf-dev libsuitesparse-dev libwebp-dev ninja-build protobuf-compiler python-sphinx
  1. Clone and build Cartographer:
git clone https://github.com/cartographer-project/cartographer.git
cd cartographer && mkdir build && cd build
cmake .. -G Ninja
ninja
ninja test
sudo ninja install
  1. Run a demo:
cartographer_assets_writer --configuration_directory ~/cartographer/configuration_files --configuration_basename assets_writer_backpack_2d.lua --urdf_filename ~/cartographer/configuration_files/backpack_2d.urdf --bag_filenames ~/cartographer_ros/cartographer_ros/cartographer_ros/test_data/backpack_2d.bag --output_file_prefix ~/cartographer_ros/cartographer_ros/test_data/backpack_2d

Competitor Comparisons

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.

Pros of Cartographer

  • More active development and frequent updates
  • Larger community and contributor base
  • Broader range of supported platforms and sensors

Cons of Cartographer

  • Higher complexity and steeper learning curve
  • Potentially higher computational requirements
  • Less flexibility for customization in certain scenarios

Code Comparison

Cartographer:

void LocalTrajectoryBuilder2D::AddImuData(const sensor::ImuData& imu_data) {
  CHECK(timed_pose_queue_.empty() ||
        imu_data.time >= timed_pose_queue_.back().time);
  imu_data_.push_back(imu_data);
  TrimImuData();
}

Cartographer>:

void LocalTrajectoryBuilder2D::AddImuData(const sensor::ImuData& imu_data) {
  CHECK(timed_pose_queue_.empty() ||
        imu_data.time >= timed_pose_queue_.back().time);
  imu_data_.push_back(imu_data);
}

The main difference in this code snippet is that Cartographer includes a TrimImuData() function call, which is not present in Cartographer>. This suggests that Cartographer may have additional data management features or optimizations in place.

2,713

RTAB-Map library and standalone application

Pros of RTAB-Map

  • More versatile, supporting various sensors and input types (stereo, RGB-D, lidar)
  • Better suited for large-scale mapping and loop closure detection
  • Includes built-in visualization tools and GUI for easier data interpretation

Cons of RTAB-Map

  • Generally slower processing speed compared to Cartographer
  • May require more computational resources, especially for large maps
  • Steeper learning curve due to more complex configuration options

Code Comparison

RTAB-Map (C++):

#include <rtabmap/core/Rtabmap.h>
#include <rtabmap/core/RtabmapThread.h>

rtabmap::Rtabmap rtabmap;
rtabmap::RtabmapThread rtabmapThread(&rtabmap);
rtabmapThread.start();

Cartographer (C++):

#include "cartographer/mapping/map_builder.h"
#include "cartographer/sensor/range_data.h"

auto map_builder = cartographer::mapping::CreateMapBuilder(map_builder_options);
map_builder->AddTrajectoryBuilder(trajectory_options);

Both libraries offer powerful SLAM capabilities, but RTAB-Map is more versatile and feature-rich, while Cartographer focuses on efficiency and real-time performance. The choice between them depends on specific project requirements and hardware constraints.

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities

Pros of ORB_SLAM2

  • Lightweight and efficient, suitable for real-time applications
  • Robust loop closure and relocalization capabilities
  • Works well in feature-rich environments

Cons of ORB_SLAM2

  • Limited to visual SLAM, doesn't incorporate other sensor data
  • May struggle in feature-poor or dynamic environments
  • Less suitable for large-scale mapping

Code Comparison

ORB_SLAM2 (C++):

// Feature extraction and matching
void Frame::ExtractORB(int flag, const cv::Mat &im)
{
    (*mpORBextractorLeft)(im,cv::Mat(),mvKeys,mDescriptors);
}

Cartographer (C++):

// Multi-sensor fusion
void LocalTrajectoryBuilder2D::AddRangefinderData(
    const sensor::TimedPointCloudData& rangefinder_data) {
  // Sensor data processing and integration
}

ORB_SLAM2 focuses on visual features for SLAM, while Cartographer is designed for multi-sensor fusion, including lidar and IMU data. ORB_SLAM2 is more specialized for visual SLAM, whereas Cartographer offers a more comprehensive approach to mapping and localization across various sensor types and environments.

3D LIDAR-based Graph SLAM

Pros of hdl_graph_slam

  • Specifically designed for 3D LiDAR data, offering better performance for point cloud processing
  • Implements loop closure detection using a deep learning-based approach, potentially improving accuracy in complex environments
  • Provides visualization tools for graph optimization and mapping results

Cons of hdl_graph_slam

  • Less mature and less widely adopted compared to Cartographer
  • May require more computational resources due to the deep learning-based loop closure detection
  • Limited to LiDAR-based SLAM, while Cartographer supports multiple sensor types

Code Comparison

hdl_graph_slam:

void GraphSLAM::add_se3_node(const Eigen::Isometry3d& pose) {
  Vertex* v = graph.add_vertex(pose);
  keyframe_queue.push_back(v);
}

Cartographer:

void PoseGraph3D::AddNode(
    std::shared_ptr<const TrajectoryNode::Data> constant_data,
    const std::vector<std::shared_ptr<const Submap3D>>& insertion_submaps) {
  const NodeId node_id = AppendNode(constant_data, insertion_submaps);
  AddWorkItem([this, node_id]() REQUIRES(mutex_) { OptimizeAfterNode(node_id); });
}

Both projects implement graph-based SLAM algorithms, but hdl_graph_slam focuses on LiDAR data processing, while Cartographer offers a more general-purpose solution for various sensor types and configurations.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

.. Copyright 2016 The Cartographer Authors

.. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

============ Cartographer

|build-jammy| |build-focal| |build-bionic| |build-bullseye| |build-buster| |docs| |license|

Purpose

Cartographer_ is a system that provides real-time simultaneous localization and mapping (SLAM_) in 2D and 3D across multiple platforms and sensor configurations.

|video|

.. _Cartographer: https://github.com/cartographer-project/cartographer .. _SLAM: https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping

A Note for ROS Users

Cartographer is no longer actively maintained. On rare occasions critical pull requests may be merged, but no new development is currently taking place, including issue response. If you are installing Cartographer in ROS 1 / ROS 2 using a binary package that package is a fork of this repository. The ROS fork of Cartographer is only maintained in a limited capacity. No new development takes place on this fork, but pull requests may be merged at the maintainers' discretion.

The ROS fork of Cartographer, and the ROS wrapper library, can be found at these locations:

  • Cartographer Fork <https://github.com/ros2/cartographer>_
  • Cartographer ROS <https://github.com/ros2/cartographer_ros>_

Additional discussion can be found in this ROS Discourse thread<https://discourse.ros.org/t/rolling-and-soon-humble-release-of-both-cartographer-and-cartographer-ros-v2-and-call-for-testing/25137>_.

Getting started

  • Learn to use Cartographer at our Read the Docs site_.
  • You can ask a question by creating an issue_.

.. _our Read the Docs site: https://google-cartographer.readthedocs.io .. _creating an issue: https://github.com/cartographer-project/cartographer_ros/issues/new?labels=question

Contributing

You can find information about contributing to Cartographer at our Contribution page_.

.. _our Contribution page: https://github.com/cartographer-project/cartographer/blob/master/CONTRIBUTING.md

Open house slide archive

In the past there had been regular open-for-all meetings to discuss progress and plans for Cartographer. Slides of these Cartographer Open House meetings are listed below.

  • March 14, 2019: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/190314/slides.pdf>_
  • February 21, 2019: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/190221/slides.pdf>_
  • January 17, 2019: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/190117/slides.pdf>_
  • November 22, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/181122/slides.pdf>_
  • October 25, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/181025/slides.pdf>_
  • September 13, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180913/slides.pdf>_
  • August 16, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180816/slides.pdf>_
  • August 2, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180802/slides.pdf>_
  • July 5, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180705/slides.pdf>_
  • June 21, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180621/slides.pdf>_
  • June 7, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180607/slides.pdf>_
  • May 24, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180524/slides.pdf>_
  • May 3, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180503/slides.pdf>_
  • March 29, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180329/slides.pdf>_
  • February 22, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180222/slides.pdf>_
  • February 8, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180208/slides.pdf>_
  • January 18, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180125/slides.pdf>_
  • January 11, 2018: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/180111/slides.pdf>_
  • December 7, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/171207/slides.pdf>_
  • November 23, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/171123/slides.pdf>_
  • November 9, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/171109/slides.pdf>_
  • October 26, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/171026/slides.pdf>_
  • October 12, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/171012/slides.pdf>_
  • September 14, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170914/slides.pdf>_
  • August 17, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170817/slides.pdf>_
  • July 20, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170720/slides.pdf>_
  • July 6, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170706/slides.pdf>_
  • June 22, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170622/sildes.pdf>_
  • June 8, 2017: Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170608/slides.pdf>_

.. |build-jammy| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-jammy.yaml/badge.svg :alt: Ubuntu 22.04 Build Status :scale: 100% :target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-jammy.yaml .. |build-focal| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-focal.yaml/badge.svg :alt: Ubuntu 20.04 Build Status :scale: 100% :target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-focal.yaml .. |build-bionic| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bionic.yaml/badge.svg :alt: Ubuntu 18.04 Build Status :scale: 100% :target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bionic.yaml .. |build-bullseye| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bullseye.yaml/badge.svg :alt: Debian Bullseye Build Status :scale: 100% :target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bullseye.yaml .. |build-buster| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-buster.yaml/badge.svg :alt: Debian Buster Build Status :scale: 100% :target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-buster.yaml .. |docs| image:: https://readthedocs.org/projects/google-cartographer/badge/?version=latest :alt: Documentation Status :scale: 100% :target: https://google-cartographer.readthedocs.io/en/latest/?badge=latest .. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg :alt: Apache 2 license. :scale: 100% :target: https://github.com/cartographer-project/cartographer/blob/master/LICENSE .. |video| image:: https://j.gifs.com/wp3BJM.gif :alt: Cartographer 3D SLAM Demo :scale: 100% :target: https://youtu.be/DM0dpHLhtX0