Skip to content
MRPTPublic

Repository files navigation

Mobile Robot Programming Toolkit (MRPT)

C++ and Python libraries and apps for mobile robotics: SLAM, localization, navigation,
3D geometry, sensors and visualization. Open source since 2005.

Linux build macOS build Windows build codecov

Latest release PyPI Packaging status DOI License

Documentation · Tutorials · API Reference · Examples · Applications · Discussions

MRPT in action: a Husky robot mapping and navigating with MOLA and MRPT, LiDAR odometry on several robots, MRPT GUI apps, 3D rendering and MVSim


What is MRPT?

MRPT is a modular C++ framework for mobile robotics, started in 2005 at the University of Málaga and actively maintained since then, with Python bindings for most of it. It is used in research and industry, and it is the core library of the MOLA SLAM framework and the MVSim simulator.

MRPT 3 splits the library into independent colcon packages, cleans up the public API and moves to modern C++17, while keeping the data structures and algorithms MRPT has always been known for.

Area What's included
SLAM & localization Particle filter localization, RBPF, EKF and graph SLAM, ICP; 3D LiDAR odometry and SLAM through MOLA
Geometry SE(2)/SE(3) poses and Lie groups, probability distributions over poses, geodetic/UTM/ENU coordinates
Estimation Kalman and particle filters, RANSAC, least squares
Maps 2D/3D occupancy grids, point clouds, voxel maps, OctoMap, landmark and gas maps
Sensors Dataset (rawlog) support for LiDARs, cameras, RGB-D, IMU, GNSS; hardware drivers
Navigation Reactive navigation with PTGs, path planning
Visualization 3D scene graph rendered with OpenGL (shadows, SSAO, instancing), ImGui-based apps and windows
Python pybind11 bindings for the main modules; pip wheels for Linux
Platforms Linux, Windows, macOS; ROS 2 Humble, Jazzy, Kilted, Lyrical and Rolling

Install

Python (pip)

pip install mrpt3
from mrpt.poses import CPose3D
print(CPose3D(1.0, 2.0, 0.0, 0.5, 0.0, 0.0) + CPose3D(0.5, 0.0, 0.0, 0.0, 0.0, 0.0))

Linux (x86_64, aarch64), Python 3.10 or newer. The wheel also contains the C++ headers, libraries and CMake files. See the Python examples and the interactive MRPT notebooks.

ROS 2

# All libraries and apps:
sudo apt install ros-$ROS_DISTRO-mrpt-apps-cli ros-$ROS_DISTRO-mrpt-apps-gui
# Or only the modules you need, e.g.:
sudo apt install ros-$ROS_DISTRO-mrpt-maps
Distro Build dev Release
ROS 2 Humble (u22.04) Build Status Version
ROS 2 Jazzy (u24.04) Build Status Version
ROS 2 Kilted (u24.04) Build Status Version
ROS 2 Lyrical (u26.04) Build Status Version
ROS 2 Rolling (u26.04) Build Status Version

Binary builds of every package, per distro and platform (Ubuntu amd64/arm64, RHEL, Fedora): ROS build farm status.

Ubuntu (PPA)

sudo add-apt-repository ppa:joseluisblancoc/mrpt3-stable   # or mrpt3-develop, for nightly builds
sudo apt install libmrpt-dev mrpt-apps

For Ubuntu 24.04 and 26.04. Other distributions: see which ones package MRPT.

Windows

Nightly Windows installer, with the apps (.exe), libraries (.dll, .lib) and headers.

Build from source

git clone https://github.com/MRPT/mrpt.git --recursive
cd mrpt

Install build dependencies with rosdep (recommended, works even without ROS installed):

sudo apt install python3-rosdep
sudo rosdep init   # only once per machine
rosdep update
rosdep install --from-paths . --ignore-src -r -y

Then build with colcon:

colcon build

See the full build guide for CMake options and dependencies.


Quick start (C++)

Align two point clouds with ICP:

#include <mrpt/maps/CSimplePointsMap.h>
#include <mrpt/random.h>
#include <mrpt/slam/CICP.h>

#include <iostream>

int main()
{
  // A random 2D point cloud, and the same points seen from another pose:
  mrpt::maps::CSimplePointsMap ref;
  auto& rng = mrpt::random::getRandomGenerator();
  for (int i = 0; i < 1000; i++)
  {
    ref.insertPoint(rng.drawUniform(-10.0f, 10.0f), rng.drawUniform(-10.0f, 10.0f));
  }
  const mrpt::poses::CPose2D truePose(0.5, -0.3, mrpt::DEG2RAD(10.0));
  mrpt::maps::CSimplePointsMap scan = ref;
  scan.changeCoordinatesReference(-truePose);

  // Align them with ICP, starting from the identity:
  mrpt::slam::CICP icp;
  const auto pdf = icp.Align(&ref, &scan, mrpt::poses::CPose2D());

  std::cout << "True pose: " << truePose << "\nICP:       " << pdf->getMeanVal() << "\n";
}
cmake_minimum_required(VERSION 3.16)
project(my_robot_app)

find_package(mrpt_slam REQUIRED)

add_executable(icp_example icp_example.cpp)
target_link_libraries(icp_example mrpt::mrpt_slam)

With MRPT from ROS 2 (after sourcing its setup.bash) or from the PPA, CMake finds it as is. With the pip wheel, which ships the C++ SDK, pass its CMake prefix:

cmake -S . -B build -DCMAKE_PREFIX_PATH="$(python3 -c 'import mrpt.sdk; print(mrpt.sdk.get_cmake_prefix_path())')"

More in the C++ examples.

Migrating from MRPT 2.x? See the porting guide: packages were renamed from mrpt-<name> to mrpt_<name>, and CMake targets from mrpt::<name> to mrpt::mrpt_<name>.


Applications

GUI apps for datasets, 3D scenes, navigation and SLAM, plus command-line tools such as rawlog-edit. See all applications.

RawLogViewer
RawLogViewer

Inspect, edit and process datasets
SceneViewer3D
SceneViewer3D

3D scenes, models and point clouds
GridmapNavSimul
GridmapNavSimul

Simulate a robot and its sensors in a map
navlog-viewer
navlog-viewer

Debug reactive navigation logs
holonomic-navigator-demo
holonomic-navigator-demo

Holonomic obstacle avoidance
2d-slam-demo
2d-slam-demo

EKF SLAM step by step

Ecosystem

Projects built on MRPT:

Project Description
MOLA Modular LiDAR odometry, SLAM and localization, for ROS 2 or standalone
mp2p_icp Point cloud registration (ICP) and processing pipelines
MVSim Lightweight, realistic 2.5D simulator for mobile robots and multi-agent research
mrpt_path_planning Kinematically-feasible path planning (TPS-A*) for arbitrary robot shapes
mrpt_navigation ROS 2 nodes for localization, map servers, path planning and reactive navigation
mrpt_sensors ROS 2 drivers for robotics sensors
mrpt_ros_bridge Conversions between MRPT classes and ROS 2 messages
mrpt-notebooks Interactive Python tutorials (marimo notebooks)

Modules

Each module is an independent colcon package that can be built and used on its own:

Group Modules
Foundations mrpt_common mrpt_core mrpt_typemeta mrpt_rtti mrpt_containers mrpt_serialization mrpt_io mrpt_system mrpt_config mrpt_expr mrpt_random mrpt_comms
Math & geometry mrpt_math mrpt_poses mrpt_tfest mrpt_bayes mrpt_graphs mrpt_topography mrpt_kinematics
Sensors & data mrpt_obs mrpt_img mrpt_hwdrivers mrpt_data
Maps, SLAM & navigation mrpt_maps mrpt_slam mrpt_graphslam mrpt_nav
Visualization & GUI mrpt_viz mrpt_opengl mrpt_gui mrpt_imgui mrpt_imgui_vendor
Apps & examples mrpt_libapps_cli mrpt_libapps_gui mrpt_apps_cli mrpt_apps_gui mrpt_examples_cpp

Documentation

Resource Link
API reference docs.mrpt.org/reference/latest/modules.html
Tutorials docs.mrpt.org/reference/latest/tutorials.html
C++ examples docs.mrpt.org/reference/latest/examples.html
Python examples docs.mrpt.org/reference/latest/python_examples.html
Python API reference docs.mrpt.org/reference/latest/python_api.html
Docs for AI agents llms.txt, examples.json, and a .md version of every page
Supported sensors docs.mrpt.org/reference/latest/supported-sensors.html
ROS wrappers docs.mrpt.org/reference/latest/wrappers.html
Changelog docs.mrpt.org/reference/latest/page_changelog.html
Robotics datasets mrpt.org/robotics_datasets

Community & support

Citing MRPT

If MRPT helps your research, please cite it with its Zenodo DOI 10.5281/zenodo.10595286, which resolves to the latest release and provides BibTeX and other formats.

License

Released under the BSD 3-Clause License.

Contributors

Contributors