I'm having issues with ROS2 discovery. I managed to dumb down the problem to the dockerfile below:
version: "3.3"
services:
discovery-server:
image: ros:humble
environment:
RMW_IMPLEMENTATION: rmw_fastrtps_cpp
network_mode: host
command: /bin/bash -c 'source /opt/ros/humble/setup.bash && fastdds discovery -i 0'
talker:
image: ros:humble
environment:
RMW_IMPLEMENTATION: rmw_fastrtps_cpp
ROS_DISCOVERY_SERVER: 127.0.0.1:11811
network_mode: host
command: /bin/bash -c 'apt-get update -qq && apt-get install -qqy ros-humble-demo-nodes-cpp && source /opt/ros/humble/setup.bash && ros2 run demo_nodes_cpp talker'
listener:
image: ros:humble
environment:
RMW_IMPLEMENTATION: rmw_fastrtps_cpp
ROS_DISCOVERY_SERVER: 127.0.0.1:11811
network_mode: host
command: /bin/bash -c 'apt-get update -qq && apt-get install -qqy ros-humble-demo-nodes-cpp && source /opt/ros/humble/setup.bash && ros2 run demo_nodes_cpp listener'
This file seems to be working on my (Mint 20.3) PC, but not on the robot (Ubuntu-server 20.04). I tested two other ubuntu setups: ubuntu 20.04 desktop works and ubuntu 22.04 server does not. Not sure if the versions are relevant, because well, docker?
What could be wrong with the setup above?
Note that the example above also breaks on a ros:galactic
image with ros-galactic-rmw-fastrtps-cpp
installed.
Originally posted by Timple86 on ROS Answers with karma: 80 on 2022-07-26
Post score: 0