All Projects → christophebedard → rmw_email

christophebedard / rmw_email

Licence: Apache-2.0 license
ROS 2 over email: a middleware implementation

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to rmw email

rmw ecal
ROS2 middleware based on eCAL
Stars: ✭ 30 (-25%)
Mutual labels:  ros2, rmw
orca3
ROS2 AUV based on the BlueRobotics BlueROV2 and Navigation2
Stars: ✭ 43 (+7.5%)
Mutual labels:  ros2
Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+4590%)
Mutual labels:  ros2
ros msft camera
This ROS node uses Windows Media Foundation's frame server to efficiently process camera frames.
Stars: ✭ 17 (-57.5%)
Mutual labels:  ros2
dynamixel control
ros2_control packages for ROBOTIS Dynamixel
Stars: ✭ 69 (+72.5%)
Mutual labels:  ros2
ros-docker-gui
ROS Docker Containers with X11 (GUI) support [Linux]
Stars: ✭ 137 (+242.5%)
Mutual labels:  ros2
raspimouse ros2 examples
ROS 2 examples for Raspberry Pi Mouse
Stars: ✭ 29 (-27.5%)
Mutual labels:  ros2
pcl localization ros2
ROS2 package of 3D LIDAR-based Localization using PCL (Not SLAM)
Stars: ✭ 74 (+85%)
Mutual labels:  ros2
transport drivers
A set of ROS2 drivers for transport-layer protocols.
Stars: ✭ 41 (+2.5%)
Mutual labels:  ros2
isaac ros dnn inference
Hardware-accelerated DNN model inference ROS2 packages using NVIDIA Triton/TensorRT for both Jetson and x86_64 with CUDA-capable GPU
Stars: ✭ 67 (+67.5%)
Mutual labels:  ros2
dockerfiles
Dockerfiles I use for development
Stars: ✭ 64 (+60%)
Mutual labels:  ros2
DDS-Router
The DDS Router is an application developed by eProsima that allows, using Fast DDS, to communicate by DDS protocol different networks.
Stars: ✭ 34 (-15%)
Mutual labels:  ros2
kvaser interface
A Kvaser CAN interface ROS abstraction layer.
Stars: ✭ 72 (+80%)
Mutual labels:  ros2
li slam ros2
ROS2 package of tightly-coupled lidar inertial ndt/gicp slam
Stars: ✭ 160 (+300%)
Mutual labels:  ros2
slam gmapping
Slam Gmapping for ROS2
Stars: ✭ 56 (+40%)
Mutual labels:  ros2
awesome-webots
Awesome Webots
Stars: ✭ 46 (+15%)
Mutual labels:  ros2
vscode ros2 workspace
A template for using VSCode as an IDE for ROS2 development.
Stars: ✭ 527 (+1217.5%)
Mutual labels:  ros2
Nindamani-the-weed-removal-robot
Nindamani, the AI based mechanically weed removal robot
Stars: ✭ 73 (+82.5%)
Mutual labels:  ros2
rclrust
Yet another ROS2 Rust client
Stars: ✭ 42 (+5%)
Mutual labels:  ros2
docker
Docker-related material to setup, configure and develop with micro-ROS hardware.
Stars: ✭ 32 (-20%)
Mutual labels:  ros2

rmw_email

Latest GitHub tag GitHub workflow status License

ROS 2 over email. rmw_email contains a middleware that sends & receives strings over email and an RMW implementation that allows ROS 2 to use this middleware to exchange messages.

For an overview of the motivation and process behind this project, see this blog post: christophebedard.com/ros-2-over-email.

  1. Overview
  2. Packages
  3. Supported features
    1. Platform support
  4. Performance
  5. How to use
  6. Configuration
  7. Tracing
  8. Logging
  9. email examples

Overview

overview diagram, from ROS 2 (rcl) to the email server(s) and back up to ROS 2

rmw_email_cpp uses type support introspection to convert messages to YAML objects. This is done for both C and C++ type supports using the dynmsg package. The YAML objects are then converted to strings.

Those strings are sent via email using the email package. The topic name is used as the email subject; the email body contains the YAML string representing the message. Messages can therefore easily be read.

example of resulting emails after two 'hello world' messages on the '/chatter' topic

To receive messages, this process is repeated in the opposite direction.

Successive messages on the same topic generally end up in the same email thread (depending on the client). Service responses are email replies to the corresponding email request (this is handled by email).

example of resulting emails for a service request and then response

email also has an intraprocess communication mode to bypass actually sending and receiving emails.

Packages

This repository contains a few packages:

Supported features

The following table shows the features currently supported/unsupported by rmw_email_cpp.

ROS 2 feature Status
publishers/subscriptions ✔️
services, actions ✔️
introspection using ros2 * commands
QoS, rmw events

Platform support

rmw_email was primarily developed on Ubuntu. However, it should work on macOS and Windows without too much effort. See REP 2000.

Performance

We can use performance_test to compare the performance of rmw_email_cpp to another RMW implementation.

latency comparison between rmw_email_cpp and rmw_cyclonedds_cpp

See the perf_test.sh and perf_plot.sh scripts to run performance_test and generate a plot like the one above.

How to use

  1. Clone this repo into your ROS 2 workspace
    $ cd ~/ws/src/
    $ git clone https://github.com/christophebedard/rmw_email.git
  2. Clone dependencies
    $ cd ~/ws/
    $ vcs import src --input https://raw.githubusercontent.com/christophebedard/rmw_email/master/dependencies.repos
  3. Build
    $ cd ~/ws/
    $ colcon build  # ...
  4. Create email configuration file(s) for your executable(s)
    See configuration.
  5. Use by setting the RMW_IMPLEMENTATION environment variable to rmw_email_cpp and the EMAIL_CONFIG_FILE environment variable to your configuration file, e.g.
    $ cd ~/ws/
    $ source install/setup.bash
    $ export RMW_IMPLEMENTATION=rmw_email_cpp
    $ export EMAIL_CONFIG_FILE=path/to/email.yml
    $ ros2 run demo_nodes_cpp talker
    $ # ...

Configuration

In order to send & receive emails, a YAML configuration file must be provided. By default, the path to the config file is email.yml, relative to the current working directory. However, the path can be changed using the EMAIL_CONFIG_FILE environment variable, e.g., EMAIL_CONFIG_FILE=other/dir/myemail.yml. If that file does not exist, ~/email.yml will be used as a backup if it exists.

A sample configuration file is provided: email.yml. As for the values:

  • url-smtp: SMTP server URL
    • for Gmail: smtp.gmail.com
  • url-imap: IMAP server URL
    • for Gmail: imap.gmail.com
  • username: your email address
  • password: your password
    • it is recommended to generate a "unique" password. For Gmail, that is an app password. Under Select app, click Other (Custom name) and simply enter something like rmw_email. Copy the generated password and paste it in the config file.
  • to/cc/bcc: recipients
  • polling-period: email polling period in nanoseconds
    • optional; by default, polling will be done as fast as possible
  • intraprocess: enable intraprocess mode by setting to true
    • optional; by default, intraprocess is disabled
    • this makes email act as if it was sending emails to itself and entirely bypasses actually sending and receiving emails
    • all other options are optional and have no effect in practice if intraprocess is enabled

Using the same configuration file with the same email for the username and to fields (i.e., same email address for sending & receiving) for multiple executables should work. Alternatively, you can use two different configuration files for two different executables, e.g., if they're sending emails to each other.

Tracing

email has LTTng tracepoints for publishers and subscriptions. See email/include/email/lttng.hpp. Tracepoints are automatically included if LTTng is installed and detected. To completely remove them, build with --cmake-args -DEMAIL_ENABLE_TRACING=OFF.

rmw_email_cpp supports the ros2_tracing tracepoints for the rmw layer. It also has another LTTng tracepoint in order to link ROS 2 messages to email messages. See rmw_email_cpp/include/rmw_email_cpp/lttng.hpp. See ros2_tracing's README for information on how to enable or disable tracepoints.

Logging

There are a few logging options for email itself:

  1. Set the console logging level through the EMAIL_LOG_LEVEL environment variable, e.g., EMAIL_LOG_LEVEL=debug.
    • The logging levels are: off, debug, info, warn, error, and fatal.
    • The default level is info.
  2. Write all logs to a file by setting the EMAIL_LOG_FILE environment variable to a file path.
    • This writes all logs to the file, independently of the logging level set through EMAIL_LOG_LEVEL.
    • A leading ~ is expanded to the user's home directory.
  3. Set the EMAIL_CURL_VERBOSE environment variable to be non-empty, e.g., EMAIL_CURL_VERBOSE=y. This will enable libcurl's verbose option.
    • Generally produces too much output to be useful.

As for rmw_email_cpp, simply use the existing logging configuration options, including:

  1. CLI option
    $ ros2 run $pkg $exec --ros-args --log-level debug
    $ ros2 run $pkg $exec --ros-args --log-level rmw_email_cpp:=debug

email examples

The email_examples package contains simple examples using email:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].