You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-11Lines changed: 29 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@
13
13
The *mqtt_client* package provides a ROS nodelet or ROS 2 node that enables connected ROS-based devices or robots to exchange ROS messages via an MQTT broker using the [MQTT](http://mqtt.org) protocol. This works generically for arbitrary ROS message types. The *mqtt_client* can also exchange primitive messages with MQTT clients running on devices not based on ROS.
14
14
15
15
-[Installation](#installation)
16
+
-[docker-ros](#docker-ros)
16
17
-[Usage](#usage)
17
18
-[Quick Start](#quick-start)
18
19
-[Launch](#launch)
@@ -38,7 +39,7 @@ If you would like to install *mqtt_client* from source, simply clone this reposi
*mqtt_client* is also available as a Docker image, containerized through [*docker-ros*](https://github.com/ika-rwth-aachen/docker-ros).
54
+
55
+
```bash
56
+
# ROS
57
+
docker run --rm ghcr.io/ika-rwth-aachen/mqtt_client:ros
58
+
59
+
# ROS 2
60
+
docker run --rm ghcr.io/ika-rwth-aachen/mqtt_client:ros2
61
+
```
62
+
50
63
51
64
## Usage
52
65
@@ -99,7 +112,7 @@ bridge:
99
112
After building your ROS workspace, launch the *mqtt_client* nodelet with the pre-configured demo parameters using *roslaunch*, which should yield the following output.
100
113
101
114
```bash
102
-
# ROS 1
115
+
# ROS
103
116
roslaunch mqtt_client standalone.launch
104
117
105
118
# ROS 2
@@ -128,7 +141,7 @@ In order to test the communication among *mqtt_clients*, publish any ROS message
This will automatically load the provided demo [`params.yaml`](mqtt_client/config/params.yaml) / [`params.ros2.yaml`](mqtt_client/config/params.ros2.yaml). If you wish to load your custom configuration file, simply pass `params_file`.
As seen in the [Quick Start](#quick-start), the *mqtt_client* can not only exchange arbitrary ROS messages with other *mqtt_clients*, but it can also exchange primitive message data with other non-*mqtt_client* MQTT clients. This allows ROS-based devices to exchange primitive messages with devices not based on ROS. The `primitive` parameter can be set for both ROS-to-MQTT (`bridge/ros2mqtt`) and for MQTT-to-ROS (`bridge/mqtt2ros`) transmissions.
@@ -280,6 +294,7 @@ If a ROS-to-MQTT transmission is configured as `primitive` and the ROS message t
280
294
281
295
If an MQTT-to-ROS transmission is configured as `primitive`, the MQTT message is interpreted and published as a primitive data type, if possible. The message is probed in the following order: `bool`([`std_msgs/Bool`](http://docs.ros.org/en/api/std_msgs/html/msg/Bool.html)), `int` ([`std_msgs/Int32`](http://docs.ros.org/en/api/std_msgs/html/msg/Int32.html)), `float` ([`std_msgs/Float32`](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html)), `string` ([`std_msgs/String`](http://docs.ros.org/en/api/std_msgs/html/msg/String.html)).
282
296
297
+
283
298
## Latency Computation
284
299
285
300
The *mqtt_client* provides built-in functionality to measure the latency of transferring a ROS message via an MQTT broker back to ROS. Note that this functionality is only available for non-primitive messages (see [Primitive Messages](#primitive-messages)). To this end, the sending client injects the current timestamp into the MQTT message. The receiving client can then compute the latency between message reception time and the injected timestamp. **Naturally, this is only accurate to the level of synchronization between clocks on sending and receiving machine.**
@@ -289,7 +304,7 @@ In order to inject the current timestamp into outgoing MQTT messages, the parame
289
304
These latencies can be printed easily with *rostopic echo*
ros2 run rqt_plot rqt_plot /<mqtt_client_name>/latencies/<mqtt2ros/ros_topic>/data
307
322
```
308
323
324
+
309
325
## Package Summary
310
326
311
327
This short package summary documents the package in line with the [ROS Wiki Style Guide](http://wiki.ros.org/StyleGuide).
312
328
313
-
### ROS 1
329
+
### ROS
314
330
315
331
#### Nodelets
316
332
@@ -368,9 +384,10 @@ Enables connected ROS-based devices or robots to exchange ROS messages via an MQ
368
384
369
385
See [Configuration](#configuration).
370
386
387
+
371
388
## How It Works
372
389
373
-
### ROS 1
390
+
### ROS
374
391
375
392
The *mqtt_client* is able to bridge ROS messages of arbitrary message type to an MQTT broker. To this end, it needs to employ generic ROS subscribers and publishers, which only take shape at runtime.
376
393
@@ -411,6 +428,7 @@ To summarize, the dataflow is as follows:
411
428
- if the message contained a timestamp, the latency is computed and published on ROS topic `~/latencies/<mqtt2ros_ros_topic>`
412
429
- the serialized ROS message is published using the *ShapeShifter* on ROS topic `<mqtt2ros_ros_topic>`
413
430
431
+
414
432
## Acknowledgements
415
433
416
434
This research is accomplished within the projects [6GEM](https://6gem.de/) (FKZ 16KISK036K) and [UNICAR*agil*](https://www.unicaragil.de/) (FKZ 16EMO0284K). We acknowledge the financial support for the projects by the Federal Ministry of Education and Research of Germany (BMBF).
0 commit comments