ROS2 Sample Project with wireguard and cyclonedds with a publisher subscriber example.
In order to use ROS2 with Cyclone DDS over a wireguard network you have to export the enviroment variables RMW_IMPLEMENTATION and CYCLONEDDS_URI.
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///$(pwd)/cyclonedds.xml
Install cyclonedds with:
sudo apt install ros-$ROS_DISTRO-rmw-cyclonedds-cpp
Change the cyclonedds.xml to fit your setup.
- Set the correct NetworkInterface
Currently:- wg-n16
- Define the peers used with there wireguard ip adresses
Currently:- 192.168.33.80
- 192.168.33.51
Compile the project with
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///$(pwd)/cyclonedds.xml
colcon build
on 192.168.33.80 run:
ros2 run examples_rclcpp_minimal_subscriber subscriber_lambda
on 192.168.33.51 run:
ros2 run examples_rclcpp_minimal_publisher publisher_lambda
The setup was testet on
- Ubuntu 22.04 with ROS humble.