Announcing mqtt_client, a C++ nodelet for bi-directionally bridging messages between ROS and MQTT

We would like to introduce our recently released package mqtt_client!

The mqtt_client package provides a ROS nodelet that enables connected ROS-based devices or robots to exchange ROS messages via an MQTT broker using the MQTT protocol. This works generically for arbitrary ROS message types.

A similar Python package mqtt_bridge already exists, but our mqtt_client brings better performance, easier and more extensive configurability, and an integrated latency measurement function.

Main features:

  • C++ nodelet for high performance and memory efficiency
  • support for arbitrary ROS message types through the use of generic publishers and subscribers
  • support for many MQTT features like QoS levels, authentication, and encryption
  • extensive configuration options on both the ROS and MQTT side
  • built-in functionality for measuring the latency of transferring a ROS message via an MQTT broker back to ROS

Below you can find a minimal configuration for sending any message on ROS topic /ping to MQTT topic /pingpong and back to ROS topic /pong on a single machine. A real use case would naturally involve one or more ROS-based machines.
Feel free to check out the Quick Start from our GitHub repository or the ROS Wiki page!

  host: localhost
  port: 1883
    - ros_topic: /ping
      mqtt_topic: pingpong
    - mqtt_topic: pingpong
      ros_topic: /pong

Sounds awesome! I need to ask the obvious question: any plans to port for ROS2?


Yes, we definitely have plans to port this to ROS2. On first look however, we are not sure yet how to realize the generic subscription and publication of arbitrary ROS message types, since something like topic_tools::ShapeShifter doesn’t seem to be available for ROS2 yet.


You might find this useful: Generic Subscriber in ROS2 - ROS Answers: Open Source Q&A Forum


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.