Basic Examples

Hello World

This example shows how to use the MiddlewareCommunicator to send and receive messages. It can be used to test the functionality of the middleware using the PUB/SUB pattern and the REQ/REP pattern. The example can be run on a single machine or on multiple machines. In this example (as with all other examples), the communication middleware is selected using the --mware argument. The default is ZeroMQ, but YARP, ROS, and ROS 2 are also supported.

Communication Schemes

Mirroring

This script demonstrates the capability to mirror messages using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB and REQ/REP patterns, allowing message publishing, listening, requesting, and replying functionalities between processes or machines.

Forwarding

This script demonstrates message forwarding using the MiddlewareCommunicator within the Wrapyfi library. The communication follows chained forwarding through two methods, enabling PUB/SUB pattern that allows message publishing and listening functionalities between processes or machines.

Channeling

This script demonstrates message channeling through three different middleware (A, B, and C) using the MiddlewareCommunicator within the Wrapyfi library. It allows message publishing and listening functionalities between processes or machines.

Communication Patterns

REQ/REP

This script demonstrates the capability to request and reply to messages using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the REQ/REP pattern, allowing message requesting and replying functionalities between processes or machines.

Custom Messages

ROS Message

This script demonstrates the capability to transmit ROS messages, specifically geometry_msgs/Pose and std_msgs/String, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing message publishing and listening functionalities between processes or machines.

ROS Parameter

This script demonstrates the capability to transmit ROS properties, specifically using the Properties message, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing property publishing and listening functionalities between processes or machines.

ROS2 Message

This script demonstrates the capability to transmit ROS 2 messages, specifically geometry_msgs/Pose and std_msgs/String, using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing message publishing and listening functionalities between processes or machines.

Plugins (Encoders)

Astropy

A message publisher and listener for native Python objects and Astropy Tables (external plugin).

Pint

A message publisher and listener for native Python objects and Pint Quantities.

Pillow

A message publisher and listener for PIL (Pillow) images.

DASK

A message publisher and listener for native Python objects and Dask Arrays/Dataframes.

NumPy and pandas

A message publisher and listener for native Python objects, NumPy Arrays, and pandas Series/Dataframes.

PyArrow

A message publisher and listener for native Python objects and PyArrow arrays.

xarray

A message publisher and listener for native Python objects and xarray DataArrays.

CuPy

A message publisher and listener for native Python objects and CuPy arrays.

Zarr

A message publisher and listener for native Python objects and Zarr arrays/groups.

JAX

A message publisher and listener for native Python objects and JAX tensors.

Trax

A message publisher and listener for native Python objects and Trax arrays.

MXNet

A message publisher and listener for native Python objects and MXNet tensors.

PaddlePaddle

A message publisher and listener for native Python objects and PaddlePaddle tensors.

PyTorch

A message publisher and listener for native Python objects and PyTorch tensors.

TensorFlow

A message publisher and listener for native Python objects and TensorFlow tensors.

Robots

iCub Head

This script demonstrates the capability to control the iCub robot’s head and view its camera feed using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern, allowing for message publishing and listening functionalities between processes or machines.

Sensors

Camera and microphone

This script demonstrates the capability to transmit audio and video streams using the MiddlewareCommunicator within the Wrapyfi library. The communication follows the PUB/SUB pattern allowing message publishing and listening functionalities between processes or machines.