0
$\begingroup$

problem:

  • Cannot communicate from ROS2 Jazzy on raspberry pi to ROS2 Jazzy on docker container on MacOS

Host

  • MacOS Version: 15.1
  • Container Image: arm64v8/ros:jazzy
  • Docker Version: 4.34.3
  • Docker Host Networking: Enabled
  • Docker Subnet: 192.168.65.0/24
  • Ping from Raspberry Pi: Successful

Robot

  • OS: Ubuntu 24.04.1 LTS
  • Ping from Mac: Successful
  • IP Address: 192.168.2.9

Docker Run Command

docker run -it --rm  \
--network host \
--pid=host \
--ipc=host \
--entrypoint \
/bin/bash \
my_jazzy

DDS Server init

rover@rover-pi:~/Fast-DDS/build$ fastdds discovery --server-id 0
### Server is running ###
Participant Type:   SERVER
Security:           NO
Server ID:          0
Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41
Server Addresses:   UDPv4:[0.0.0.0]:11811

env var pi

rover@rover-pi:~$ env | grep ROS_
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_AUTOMATIC_DISCOVERY_RANGE=SUBNET
ROS_DISTRO=jazzy
ROS_DISCOVERY_SERVER=192.168.2.9:11811

env var mac

dev@docker-desktop:~$ env | grep ROS_
ROS_VERSION=2
ROS_PYTHON_VERSION=3
ROS_DOMAIN_ID=1
ROS_AUTOMATIC_DISCOVERY_RANGE=SUBNET
ROS_DISTRO=jazzy
ROS_DISCOVERY_SERVER=192.168.2.9:11811

cammands tried:

pi

ros2 run demo_nodes_cpp talker --ros-args --remap __node:=talker_discovery_server

ros2 run demo_nodes_cpp talker

mac

ros2 run demo_nodes_cpp listener --ros-args --remap __node:=listener_discovery_server

ros2 run demo_nodes_py listener
$\endgroup$
6
  • $\begingroup$ Did you forget to set ROS_DOMAIN_ID on raspberry pi? $\endgroup$
    – NaOH
    Commented Nov 8 at 14:44
  • $\begingroup$ yes indeed I did, but that was not it. It still doesnt work I must also mention that i have enabled host networking from docker dashboard>settings>resources>network $\endgroup$
    – grayred8
    Commented Nov 8 at 16:41
  • $\begingroup$ adding RMW_IMPLEMENTATION=rmw_fastrtps_cpp on both host & pi didn't work either $\endgroup$
    – grayred8
    Commented Nov 8 at 17:01
  • $\begingroup$ I don't recall needing a DDS Discovery Server back on foxy when I tried something similar. I am guessing the DDS multicasts are not getting where they need to be. Maybe try adding their respective IPs to the env variable ROS_STATIC_IP link. $\endgroup$
    – NaOH
    Commented Nov 9 at 4:33
  • $\begingroup$ doesn't work ROS_STATIC_PEERS either. Tey do not communicate in subnet $\endgroup$
    – grayred8
    Commented Nov 9 at 21:12

1 Answer 1

0
$\begingroup$

My setup includes macOS, docker, Ubuntu 24.04 vm on UTM on macOS, Raspberry Pi 5 running Ubuntu 24.04. The Ubuntu images are for 64-bit ARMv8 processors and can be found here. The ros images are ROS2 Jazzy Jalisco for Arm and can be found here.

Ubuntu 24.04 on Raspberry Pi 5(Running ROS2 Jazzy)

  • Discovery Server (it could also be in container)

Docker container on Ubuntu 24.04 VM in UTM on macOS

  • listener

Docker container on Ubuntu 24.04 on Raspberry Pi 5

  • talker

Please find settings and commands below:

pi5

  • Terminal 1: run the dds server fastdds discovery -i 0 -l 192.168.2.9 -p 11811 192.168.2.9 is the IP address of the device running the server
  • Terminal 2: run docker talker container sudo docker run -it --rm --network host --ipc=host --entrypoint /bin/bash <your ROS2 image>

talker host must have ENV variable set to:

ROS_DISCOVERY_SERVER=192.168.2.9:11811
ROS_DOMAIN_ID=1

listener host must have the following:

FASTRTPS_DEFAULT_PROFILES_FILE=./super_client_configuration_file.xml
ROS_DOMAIN_ID=1

listener must have config file stored somewhere (and passed to FASTRTPS_DEFAULT_PROFILES_FILE)

    <?xml version="1.0" encoding="UTF-8" ?>
 <dds>
     <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
         <participant profile_name="super_client_profile" is_default_profile="true">
             <rtps>
                 <builtin>
                     <discovery_config>
                         <discoveryProtocol>SUPER_CLIENT</discoveryProtocol>
                         <discoveryServersList>
                             <RemoteServer prefix="44.53.00.5f.45.50.52.4f.53.49.4d.41">
                                 <metatrafficUnicastLocatorList>
                                     <locator>
                                         <udpv4>
                                             <address>192.168.2.9</address> <!-- IP address of the Discovery server that  is running-->
                                             <port>11811</port><!-- port of Discovery server that is running-->
                                         </udpv4>
                                     </locator>
                                 </metatrafficUnicastLocatorList>
                             </RemoteServer>
                         </discoveryServersList>
                     </discovery_config>
                 </builtin>
             </rtps>
         </participant>
     </profiles>
 </dds>
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.