Skip to content

Software

mrpt_ros_bridge

By MRPT, Spain (checked on github.com/MRPT (opens in a new tab)), from github.com/MRPT/mrpt_ros_bridge (opens in a new tab)

  • Navigation and mapping
  • Library
  • BSD-3-Clause

A ROS 2 package providing a C++ bridge between the MRPT toolkit and ROS 2, converting maps, sensor data, poses and images between the two message formats.

Facts

GitHub stars
3read on 28 Nov 2026
Last update
28 Nov 2026Newest commit on ros2
Maintenance
Activea commit in the last 90 days
Difficulty
Advanced

Checked on GitHub on 28 Nov 2026.

Licenses

Code
BSD-3-Clause (opens in a new tab)

Read by Robotheca from COPYING (opens in a new tab) (BSD-3-Clause) at commit 36c6d21 (opens in a new tab), on 28 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Provides bidirectional converters between MRPT data structures and ROS 2 message types, such as poses, laser scans, images, IMU, GPS fixes and point clouds.
  • Includes a rosbag2rawlog command-line tool that converts ROS 2 bag files into MRPT rawlog datasets.
  • Targets ROS 2 Humble, Jazzy, Kilted and Rolling, and is written in C++17 using ament_cmake.
  • Includes unit tests covering the conversions and message integrity.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
BSD-3-Clause. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 28 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 36c6d21

Robotheca read the repository at two versions: the summary at eb9a4d5 and the facts and the README at 36c6d21 (read on 28 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by MRPT, at commit 36c6d21, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

mrpt_ros_bridge

(opens in a new tab)

ROS 2 package providing a C++ bridge between MRPT (Mobile Robot Programming Toolkit) and the ROS 2 ecosystem. It enables seamless conversion between MRPT and ROS message types for maps, sensor data, poses, images, and more. Since version v4.0.0 this package requires MRPT>=v3.0.0.


Build Farm Status
DistroBuild devStable sync
ROS 2 Humble (u22.04)Image: Build Status (opens in a new tab) (opens in a new tab) (opens in a new tab)
ROS 2 Jazzy (u24.04)Image: Build Status (opens in a new tab) (opens in a new tab) (opens in a new tab)
ROS 2 Kilted (u24.04)Image: Build Status (opens in a new tab) (opens in a new tab) (opens in a new tab)
ROS 2 Lyrical (u26.04)Image: Build Status (opens in a new tab) (opens in a new tab) (opens in a new tab)
ROS 2 Rolling (u26.04)Image: Build Status (opens in a new tab) (opens in a new tab) (opens in a new tab)

Individual package build status

| Package | ROS 2 Humble BinBuild | ROS 2 Jazzy BinBuild | ROS 2 Kilted BinBuild | ROS 2 Rolling BinBuild | ROS 2 Lyrical BinBuild | | --- | --- | --- | --- | --- | --- | | mrpt_libros_bridge | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | | rosbag2rawlog | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | | rawlog2rosbag | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) | Image: Build Status (opens in a new tab) (opens in a new tab) |


Overview

The mrpt_libros_bridge library provides bidirectional converters between MRPT data structures and ROS 2 message types.
It simplifies integrating MRPT-based algorithms (e.g. SLAM, perception, mapping) with ROS 2 nodes.

Included packages
PackageDescription
mrpt_libros_bridgeCore C++ library bridging MRPT data types with ROS 2 messages (poses, maps, sensor data, etc.).
rosbag2rawlogCommand-line tool to convert ROS 2 .bag files into MRPT .rawlog datasets.
rawlog2rosbagCommand-line tool to convert MRPT .rawlog datasets into ROS 2 bags (.mcap, .db3).

Features
  • Convert between MRPT and ROS 2 types:
    • geometry_msgs::Pose ⇄ mrpt::poses::CPose3D
    • sensor_msgs::LaserScan ⇄ mrpt::obs::CObservation2DRangeScan
    • sensor_msgs::Image ⇄ mrpt::img::CImage
    • sensor_msgs::Imu, NavSatFix, PointCloud2, etc.
  • Compatible with ROS 2 distros: Humble, Jazzy, Kilted, and Rolling.
  • Written in C++17, using ament_cmake.
  • Includes unit tests for conversions and message integrity.

Installing

Install from ROS build servers with:

sudo apt install ros-${ROS_DISTRO}-rosbag2rawlog ros-${ROS_DISTRO}-rawlog2rosbag ros-${ROS_DISTRO}-mrpt-libros-bridge
Building from sources

If needed to build from source code, do this:

# Source your ROS 2 environment
source /opt/ros/jazzy/setup.bash

# Clone dependencies
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/MRPT/mrpt_ros_bridge.git

# Install dependencies
rosdep install --from-paths . --ignore-src -r -y

# Build
cd ~/ros2_ws
colcon build --symlink-install

Usage Example
1. Using the conversion library
#include <mrpt_libros_bridge/pose.h>
#include <geometry_msgs/msg/pose.hpp>
#include <mrpt/poses/CPose3D.h>

geometry_msgs::msg::Pose ros_pose;
mrpt::poses::CPose3D mrpt_pose(1.0, 2.0, 0.0, 0.0, 0.0, 1.57);

mrpt::ros2bridge::toROS(mrpt_pose, ros_pose);

RGB-D and depth cameras (mrpt/ros2bridge/rgbd.h): RgbdAssembler pairs the depth, intensity (color or infrared) and camera_info topics of a camera into mrpt::obs::CObservation3DRangeScan observations. Raw or compressed images (compressedDepth PNG/RVL, JPEG/PNG), depth in 16UC1 (mm) or 32FC1 (m), so it works with Azure Kinect, ZED, RealSense, OAK-D, Orbbec... cameras, live or from bags. Used by rosbag2rawlog (type: CObservation3DRangeScan) and by MOLA.

2. Converting a ROS 2 bag to MRPT rawlog

Refer to the dataset conversions page (opens in a new tab) on the MOLA project website. For robots running inside a namespace, the config file may set tf_topic and tf_static_topic (default: /tf, /tf_static).

3. Converting an MRPT rawlog to a ROS 2 bag
rawlog2rosbag -i dataset.rawlog -o dataset_bag/

Each sensor label becomes a topic namespace and a /tf_static frame (lower case, e.g. LMS_SICK_LEFT is written to /lms_sick_left/scan in frame lms_sick_left):

MRPT observationROS 2 topic(s)
CObservation2DRangeScan<ns>/scan (sensor_msgs/LaserScan; invalid rays are +inf)
CObservationIMU<ns>/imu (sensor_msgs/Imu)
CObservationGPS<ns>/fix (sensor_msgs/NavSatFix)
CObservationImage<ns>/image_raw/compressed + <ns>/camera_info (--image-mode raw for <ns>/image_raw)
CObservationStereoImagesthe same, under <ns>/left and <ns>/right
CObservation3DRangeScan with a depth image<ns>/depth/image_raw (16UC1, mm) + <ns>/depth/camera_info, and the intensity image as a CObservationImage under <ns>/color (<ns>/ir for infrared), in the <frame>_depth_optical_frame / <frame>_color_optical_frame frames (a single one if both cameras coincide)
CObservationPointCloud<ns>/points (sensor_msgs/PointCloud2)
CObservationOdometry<ns>/odom (nav_msgs/Odometry) + /tf (odom -> base_link)
CObservationRobotPose<ns>/pose (geometry_msgs/PoseWithCovarianceStamped)
CObservationComment/rawlog_comment (std_msgs/String)
Other 3D sensors (CObservationRotatingScan, 3D range scans without a depth image,...)<ns>/points, in the base_link frame

In SensoryFrame-based rawlogs, the odometry actions are integrated into /odom + /tf. Externally stored JPEG/PNG images are copied into the bag byte by byte, without re-encoding them. RGB-D bags can be read back with RgbdAssembler (rosbag2rawlog, MOLA): depth is stored in millimeters, and intensity images as any other image (in-memory ones are lossy JPEG unless --image-mode raw); other layers (e.g. confidence) are not written. camera_info follows the actual image size if the rawlog declares another one.

Main options (see rawlog2rosbag --help):

  • -c topics.yaml: per-sensor overrides of the topic namespace and frame, or skip: true:
    sensors:
      CAMERA_LEFT:
        ns: /camera_left
        frame_id: camera_left_optical_frame
    
  • --gt-tum gt.txt: also writes a ground-truth trajectory (TUM format) to /ground_truth (nav_msgs/Odometry).
  • --storage-id mcap|sqlite3, --storage-preset zstd_fast|zstd_small|....
  • --no-latched-qos: do not store the transient_local QoS of /tf_static. Bags written with QoS profiles by ROS 2 Jazzy or newer cannot be read by ROS 2 Humble.

Testing

Run unit tests with:

colcon test --packages-select mrpt_libros_bridge rawlog2rosbag
colcon test-result --verbose

Documentation

Auto-generated API docs (Doxygen):

cd mrpt_ros_bridge
doxygen doc/rosdoc.yaml

Further information about MRPT: 👉 https://www.mrpt.org (opens in a new tab)


License

This package is distributed under the BSD License.


Maintainer

José-Luis Blanco-Claraco 📧 joseluisblancoc@gmail.com (opens in a new tab) 🔗 https://github.com/MRPT (opens in a new tab)

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.