Home

Awesome

<a href="https://integration-service.docs.eprosima.com/"><img src="https://github.com/eProsima/Integration-Service/blob/main/docs/images/logo.png?raw=true" hspace="8" vspace="2" height="100" ></a>

WebSocket System Handle

WebSocket SH CI Status   Have an issue?

Introduction

What is a System Handle?

A System Handle is a plugin that allows a certain middleware or communication protocol to speak the same language used by the eProsima Integration Service, that is, Extensible and Dynamic Topic Types for DDS (xTypes); specifically, Integration Service bases its intercommunication abilities on eProsima's open source implementation for the xTypes protocol, that is, eProsima xTypes.

<p align="center"> <a href="https://integration-service.docs.eprosima.com/en/latest/user_manual/systemhandle/sh.html"><img src="docs/images/system-handle-architecture.png"></a> </p>

The WebSocket SystemHandle

<a href="https://www.websocket.org/"><img src="docs/images/websocket_logo.png" align="left" hspace="8" vspace="2" width="90"></a>

This repository contains the source code of Integration Service System Handle for the WebSocket middleware protocol, widely used in the robotics field.

The main purpose of the WebSocket System Handle is that of establishing a connection between a WebSocket application and an application running over a different middleware implementation. This is the classic use-case approach for Integration Service.

Dependencies

This section provides a list of the dependencies needed in order to compile WebSocket System Handle.

These libraries can be installed using your Linux distribution package manager with the following command:

sudo apt-get install -y libssl-dev libwebsocketpp-dev

Configuration

Integration Service is configured by means of a YAML configuration file, which specifies the middlewares, topics and/or services involved in the intercommunication process, as well as their topic/service types and the data exchange flow. This configuration file is loaded during runtime, so there is no need to recompile any package before switching to a whole new intercommunication architecture.

To get a more precise idea on how these YAML files have to be filled and which fields they require in order to succesfully configure and launch an Integration Service project, please refer to the dedicated configuration section of the official documentation.

Regarding the WebSocket System Handle, there are several specific parameters which can be configured for the WebSocket middleware. All of these parameters fall as suboptions of the main five sections described in the Configuration chapter of Integration Service repository:

JSON encoding protocol

In order to communicate with the WebSocket System Handle using the JSON encoding, the messages should follow a specific pattern. This pattern will be different depending on the paradigm used for the connection (pub/sub or client/server) and the communication purpose.

Several fields can be used in those messages, but not all of them are mandatory. All of them will be described in this section, as well as in which cases they are optional:

Examples

There are several Integration Service examples using the WebSocket System Handle available in the project's main source code repository.

One of these examples, where the WebSocket System Handle takes part in the intercommunication process, is introduced here.

<a href="https://integration-service.docs.eprosima.com/en/latest/examples/different_protocols/pubsub/ros2-websocket.html"><img align="left" width="15" height="38" src="https://via.placeholder.com/15/40c15d/000000?text=+" alt="Green icon"></a>

WebSocket - ROS 2 bridge (publisher - subscriber)

In this example, Integration Service uses both the WebSocket Server System Handle and the ROS 2 System Handle to transmit data coming from a WebSocket Client into the ROS 2 data space, so that it can be consumed by a ROS 2 subscriber on the same topic, and viceversa.

<p align="center"> <a href="https://integration-service.docs.eprosima.com/en/latest/examples/different_protocols/pubsub/ros2-websocket.html"><img src="docs/images/websocket_ros2_pubsub_example.png" width="450"></a> </p>

The configuration file used by Integration Service for this example can be found here.

For a detailed step by step guide on how to build and test this example, please refer to the dedicated section in the official documentation.

<a href="https://integration-service.docs.eprosima.com/en/latest/examples/different_protocols/services/websocket-server.html"><img align="left" width="15" height="38" src="https://via.placeholder.com/15/40c15d/000000?text=+" alt="Green icon"></a>

WebSocket service server

In this example, the WebSocket System Handle tackles the task of bridging a WebSocket server with one or more client applications, playing the role of a service server capable of processing incoming requests from several middlewares (DDS, ROS1, ROS2) and producing an appropriate answer for them.

<p align="center"> <a href="https://integration-service.docs.eprosima.com/en/latest/examples/different_protocols/services/websocket-server.html"><img src="docs/images/websocket_services_example.png" width="550"></a> </p>

The configuration file used by Integration Service for this example can be found here.

For a detailed step by step guide on how to build and test this example, please refer to the dedicated section in the official documentation.

Compilation flags

Besides the global compilation flags available for the whole Integration Service product suite, there are some specific flags which apply only to the WebSocket System Handle; they are listed below:

Documentation

The official documentation for the WebSocket System Handle is included within the official Integration Service documentation, hosted by Read the Docs, and comprises the following sections:

License

This repository is open-sourced under the Apache-2.0 license. See the LICENSE file for more details.

Getting help

If you need support you can reach us by mail at support@eProsima.com or by phone at +34 91 804 34 48.