Skip to content

Commit cd7f4df

Browse files
committed
mention docker-ros images in readme
1 parent 1c7327f commit cd7f4df

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
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.
1414

1515
- [Installation](#installation)
16+
- [docker-ros](#docker-ros)
1617
- [Usage](#usage)
1718
- [Quick Start](#quick-start)
1819
- [Launch](#launch)
@@ -38,7 +39,7 @@ If you would like to install *mqtt_client* from source, simply clone this reposi
3839
# mqtt_client$
3940
rosdep install -r --ignore-src --from-paths .
4041

41-
# ROS 1
42+
# ROS
4243
# workspace$
4344
catkin build -DCMAKE_BUILD_TYPE=Release mqtt_client
4445

@@ -47,6 +48,18 @@ catkin build -DCMAKE_BUILD_TYPE=Release mqtt_client
4748
colcon build --packages-up-to mqtt_client --cmake-args -DCMAKE_BUILD_TYPE=Release
4849
```
4950

51+
### docker-ros
52+
53+
*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+
5063

5164
## Usage
5265

@@ -99,7 +112,7 @@ bridge:
99112
After building your ROS workspace, launch the *mqtt_client* nodelet with the pre-configured demo parameters using *roslaunch*, which should yield the following output.
100113
101114
```bash
102-
# ROS 1
115+
# ROS
103116
roslaunch mqtt_client standalone.launch
104117

105118
# ROS 2
@@ -128,7 +141,7 @@ In order to test the communication among *mqtt_clients*, publish any ROS message
128141
```bash
129142
# 1st terminal: publish ROS message to /ping
130143

131-
# ROS 1
144+
# ROS
132145
rostopic pub -r 1 /ping/ros std_msgs/String "Hello MQTT"
133146

134147
# ROS 2
@@ -138,7 +151,7 @@ ros2 topic pub /ping/ros std_msgs/msg/String "{data: \"Hello MQTT\"}"
138151
```bash
139152
# 2nd terminal: listen for ROS messages on /pong
140153

141-
# ROS 1
154+
# ROS
142155
rostopic echo /pong/ros
143156

144157
# ROS 2
@@ -166,7 +179,7 @@ ros2 topic pub /ping/primitive std_msgs/msg/Int32 "{data: 42}"
166179
```bash
167180
# 4th terminal: listen for primitive ROS messages on /pong/primitive
168181

169-
# ROS 1
182+
# ROS
170183
rostopic echo /pong/primitive
171184

172185
# ROS2
@@ -185,7 +198,7 @@ If everything works as expected, the second terminal should print a message at 1
185198
You can start the *mqtt_client* nodelet in a standalone nodelet manager with:
186199

187200
```bash
188-
# ROS 1
201+
# ROS
189202
roslaunch mqtt_client standalone.launch
190203

191204
# ROS 2
@@ -195,7 +208,7 @@ ros2 launch mqtt_client standalone.launch.ros2.xml
195208
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`.
196209

197210
```bash
198-
# ROS 1
211+
# ROS
199212
roslaunch mqtt_client standalone.launch params_file:="</PATH/TO/PARAMS.YAML>"
200213

201214
# ROS 2
@@ -272,6 +285,7 @@ bridge:
272285
latched: # [false] whether to latch ROS message
273286
```
274287

288+
275289
## Primitive Messages
276290

277291
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
280294

281295
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)).
282296

297+
283298
## Latency Computation
284299

285300
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
289304
These latencies can be printed easily with *rostopic echo*
290305

291306
```bash
292-
# ROS 1
307+
# ROS
293308
rostopic echo --clear /<mqtt_client_name>/latencies/<mqtt2ros/ros_topic>/data
294309
295310
# ROS 2
@@ -299,18 +314,19 @@ ros2 topic echo /<mqtt_client_name>/latencies/<mqtt2ros/ros_topic>/data
299314
or plotted with [rqt_plot](http://wiki.ros.org/rqt_plot):
300315

301316
```bash
302-
# ROS 1
317+
# ROS
303318
rosrun rqt_plot rqt_plot /<mqtt_client_name>/latencies/<mqtt2ros/ros_topic>/data
304319
305320
# ROS 2
306321
ros2 run rqt_plot rqt_plot /<mqtt_client_name>/latencies/<mqtt2ros/ros_topic>/data
307322
```
308323

324+
309325
## Package Summary
310326

311327
This short package summary documents the package in line with the [ROS Wiki Style Guide](http://wiki.ros.org/StyleGuide).
312328

313-
### ROS 1
329+
### ROS
314330

315331
#### Nodelets
316332

@@ -368,9 +384,10 @@ Enables connected ROS-based devices or robots to exchange ROS messages via an MQ
368384

369385
See [Configuration](#configuration).
370386

387+
371388
## How It Works
372389

373-
### ROS 1
390+
### ROS
374391

375392
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.
376393

@@ -411,6 +428,7 @@ To summarize, the dataflow is as follows:
411428
- if the message contained a timestamp, the latency is computed and published on ROS topic `~/latencies/<mqtt2ros_ros_topic>`
412429
- the serialized ROS message is published using the *ShapeShifter* on ROS topic `<mqtt2ros_ros_topic>`
413430

431+
414432
## Acknowledgements
415433

416434
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

Comments
 (0)