This package provides a Robot Operating System 2 (ROS 2) middleware (RMW) implementation for Ditto Live's edge sync capability. It enables ROS 2 to use Ditto as its underlying communication middleware, allowing for efficient data synchronization at the edge.
The RMW Ditto implementation bridges the ROS 2 middleware interface with Ditto Live's edge synchronization capabilities. It provides the necessary functionality for:
- Topic-based publish/subscribe communication
- Service-based request/response communication
- QoS-aware data exchange
- Efficient serialization and deserialization of ROS messages
- ROS 2 (Foxy or newer)
- C++14 compatible compiler
- Ditto Live client libraries (follow Ditto's installation instructions)
- Clone this repository into your ROS 2 workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/your-username/rmw_ditto.git
- Install dependencies:
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y
- Build the package:
cd ~/ros2_ws
colcon build --packages-select rmw_ditto
To use the RMW Ditto implementation with ROS 2, you need to set the RMW_IMPLEMENTATION
environment variable:
export RMW_IMPLEMENTATION=rmw_ditto
You can verify that the RMW implementation is being used by running:
ros2 doctor --report
The RMW Ditto implementation looks for a configuration file at /etc/ditto/config.json
by default. You can change this location by setting the DITTO_CONFIG_PATH
environment variable:
export DITTO_CONFIG_PATH=/path/to/your/config.json
The configuration file should contain the necessary settings for connecting to your Ditto Live instance, including:
- Connection endpoints
- Authentication credentials
- Synchronization settings
- Network parameters
# Terminal 1
export RMW_IMPLEMENTATION=rmw_ditto
ros2 topic pub /test std_msgs/String "data: Hello from Ditto RMW"
# Terminal 2
export RMW_IMPLEMENTATION=rmw_ditto
ros2 topic echo /test
# Terminal 1
export RMW_IMPLEMENTATION=rmw_ditto
ros2 run demo_nodes_cpp add_two_ints_server
# Terminal 2
export RMW_IMPLEMENTATION=rmw_ditto
ros2 service call /add_two_ints example_interfaces/srv/AddTwoInts "{a: 2, b: 3}"
The RMW Ditto implementation consists of the following main components:
- RMW Interface Implementation: Implements the standard RMW API functions required by ROS 2.
- Ditto Sync Client: Provides an abstraction layer for interacting with Ditto Live's edge sync capabilities.
- Type Support Bridge: Handles conversion between ROS 2 message types and Ditto data formats.
- QoS Adaptation Layer: Maps ROS 2 Quality of Service settings to Ditto's synchronization parameters.
The current implementation has the following limitations:
- Limited support for all ROS 2 QoS profiles
- No support for ROS 2 parameters
- Limited compatibility with ROS 2 security features
Contributions to improve the RMW Ditto implementation are welcome. Please feel free to submit issues and pull requests.
This package is licensed under the Apache License 2.0.