ROS2 Container to container communication

To-Do

Setup

In this setup, we have two containers:

  1. The Boston Dynamics ROS2 Spot ROS2 container in the an extension file build using these instructions.
  2. Our container built for Spot.

Network

Container Configuration

Extension Container
  1. You need to ssh into the CORE I/O via the default IP of 192.168.80.3 or 192.168.50.3 if you are connected directly to the CORE I/O. 
    • ssh 192.168.80.3
  2. You will need to lock down the CORE I/O to a specific port range. This is so that the containers choose ports that are open.
    • echo "21000 22000" | sudo tee /proc/sys/net/ipv4/ip_local_port_range
  3. You must restart the containers/extension after changing the ports on the CORE I/O
  4. You need to find the container id of your ROS2 installation.
    • sudo docker container ls
  1. Once you have your container id you will need to open up into the container.
    • sudo docker exec -it 8966bcde886b /bin/bash # replace "8966bcde886b" with your container id
  2. Once inside the container.
    • The Extension container was setup with the following commands to test:
ping 192.168.50.20 # Ping test the dev computer.

export ROS_DISCOVERY_SERVER=192.168.50.5:21000 # This was changed from the BD default of 192.168.80.3 because we are using our own WiFi setup that bypasses Spot's internal network.

source ./install/setup.bash # Source workspace
source /opt/ros/humble/setup.bash # Source ROS2

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

Dev Container

The Dev container was setup with the following commands to test:

ping 192.168.50.5 # Ping test the CORE I/O.

export ROS_DISCOVERY_SERVER=192.168.50.5:21000 # This was changed from the BD default of 192.168.80.3 because we are using our own WiFi setup that bypasses Spot's internal network.

source ./install/setup.bash # Source workspace
source /opt/ros/humble/setup.bash # Source ROS2

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


Revision #12
Created 24 October 2023 21:15:00 by Dwight Howard, II
Updated 10 November 2023 20:15:16 by Dwight Howard, II