Lightweight bridge that forwards DDS topics to WebSocket clients using eProsima Integration Service + Fast-DDS.
This repository provides a Docker-ready wrapper that builds and runs the eProsima Integration Service (IS) workspace and exposes a WebSocket server which forwards DDS topics to connected WebSocket clients in JSON.
- Launches the Integration Service configured by
dds_to_ws.yaml. - Uses Fast-DDS for DDS connectivity (configuration via
fastdds_profile.xml). - Serves a WebSocket endpoint (default port 80 inside container; mapped to host 8080 in
docker-compose.yml) that clients can subscribe to and receive topic messages encoded as JSON. - Provides a tiny
debug_client.htmlto test subscriptions from a browser.
Recommended: use the included docker-compose.yml which builds the image and runs the service.
- Build and start with docker-compose (from repository root):
docker compose up --build -d
- Confirm the container is running:
docker ps | grep websocket_server
- Open
debug_client.htmlin a browser (or point a WebSocket client tows://localhost:8080) and subscribe to a topic. The example client subscribes toamcl_pose.
Notes about the docker-compose setup:
- The compose file mounts several files into the container:
fastdds_profile.xml->/root/fastdds_profile.xml(used by Fast-DDS)entrypoint.sh->/usr/local/bin/entrypoint.sh(container entrypoint)types/->/root/types(IDL/type definitions)dds_to_ws.yaml->/root/dds_to_ws.yaml(IS configuration)
- The environment variable
FASTRTPS_DEFAULT_PROFILES_FILEis set to/root/fastdds_profile.xmlindocker-compose.yml.
dds_to_ws.yaml— maps DDS topics -> WebSocket endpoints, and declares message types and routing. Example content:
types:
idls:
- >
#include <geometry_msgs/PoseWithCovarianceStamped.idl>
paths: [ "./types/" ]
systems:
ws:
type: websocket_server
port: 80
security: none
encoding: json
dds: { type: fastdds }
routes:
dds_to_ws: { from: dds, to: ws }
topics:
amcl_pose:
type: "PoseWithCovarianceStamped"
route: dds_to_ws
-
fastdds_profile.xml— Fast-DDS participant profiles for discovery; useful to configure unicast discovery on networks where multicast is unavailable. -
types/— place IDL files or generated types here. The Integration Service will use types to (de)serialize DDS messages. Currently the repository contains atypes/directory (seetypes/README.md).
If you prefer to run the Integration Service locally (not inside Docker), you need to build the IS workspace and source the environment. The project's Dockerfile shows the steps used in the container: it builds Fast-DDS and the Integration Service with colcon.
Basic steps (high-level):
- Install build dependencies (colcon, compilers, git, etc.).
- Clone the required repositories into a workspace (see
Dockerfilefor repos cloned by the container). - Build with
colcon buildand sourceinstall/setup.bash. - Run the Integration Service with the provided config:
integration-service ./dds_to_ws.yaml
- Browser: open
debug_client.htmland check the developer console and Network tab. The page connects tows://localhost:8080and sends a JSON subscribe message:
{ op: 'subscribe', topic: 'amcl_pose', type: 'PoseWithCovarianceStamped' }
- You can also use any websocket client (wscat, web client) to subscribe and receive messages.
- FASTRTPS_DEFAULT_PROFILES_FILE — path to the Fast-DDS profile XML (set in
docker-compose.ymlto/root/fastdds_profile.xml).
- If the container prints
./is-workspace/install/setup.bash not foundon startup, the Integration Service build step failed. Rebuild the image or check the build logs. - Check logs with
docker logs websocket_server.
- Inputs: DDS topics available to Fast-DDS;
dds_to_ws.yamlmapping; IDL types undertypes/. - Outputs: WebSocket server on port 80 (container) that emits messages to clients in JSON.
- Error modes: missing IDL/type -> messages won't be serialized; misconfigured
fastdds_profile.xml-> discovery failures; Integration Service not built -> entrypoint will fail.
Project license: see LICENSE in repository root.