Skip to content

MRPT/mrpt_ros_bridge

Repository files navigation

mrpt_ros_bridge

CI Build colcon

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.


Build Farm Status

Distro Build dev Stable sync
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 Rolling (u24.04) Build Status Version

Individual package build status

Package ROS 2 Humble
BinBuild
ROS 2 Jazzy
BinBuild
ROS 2 Kilted
BinBuild
ROS 2 Rolling
BinBuild
mrpt_libros_bridge Build Status Build Status Build Status Build Status
rosbag2rawlog Build Status Build Status Build Status Build Status

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

Package Description
mrpt_libros_bridge Core C++ library bridging MRPT data types with ROS 2 messages (poses, maps, sensor data, etc.).
rosbag2rawlog Command-line tool to convert ROS 2 .bag files into MRPT .rawlog datasets.

Features

  • Convert between MRPT and ROS 2 types:
    • geometry_msgs::Posemrpt::poses::CPose3D
    • sensor_msgs::LaserScanmrpt::obs::CObservation2DRangeScan
    • sensor_msgs::Imagemrpt::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}-mrpt-ros-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);

2. Converting a ROS 2 bag to MRPT rawlog

Refer to the dataset conversions page on the MOLA project website.


Testing

Run unit tests with:

colcon test --packages-select mrpt_libros_bridge
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


License

This package is distributed under the BSD License.


Maintainer

José-Luis Blanco-Claraco 📧 [email protected] 🔗 https://github.com/MRPT

About

C++ library and apps for bidirectional interface MRPT <-> ROS{1,2}

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published