The webots_ros2_driver node running in a Docker container does not connect to the local simulation server running on a macOS host. The webots_tcp_client never connects, so it never starts Webots. The webots_controller instance is also unable to connect, presumably because Webots never actually launches.
Steps to Reproduce
Install Webots on the host according to the instructions. (I installed it only for the current user, not system wide.)
Download the local_simulation_server.py script on the host
Install the ROS dependencies on the guest (Docker container) according to the ROS Webots tutorial. Make sure to mount your Webots shared folder when creating the container.
On the host, run the local_simualtion_server.py script
Run the tutorial driver on the guest with ros2 launch my_package robot_launch.py
[!NOTE]
I am running ROS in a Docker container instead of a virtual machine, unlike the ROS tutorials.
Expected behavior
The WebotsLauncher and WebotsController instances launched on the guest should connect with the simulation server running on the host, and the Webots simulation app should launch. The webots_ros2_driver should connect to the spawned robot.
Affected Packages
List of affected packages:
webots_ros2_driver
Screenshots
Here's a printout snippet of the actual behavior when invoking
$ `ros2 launch my_package robot_launch.py`
[INFO] [launch]: All log files can be found below /home/vscode/.ros/log/2024-01-21-22-34-21-503797-67e608fcf059-19766
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [webots_tcp_client-1]: process started with pid [19768]
[INFO] [webots_controller_my_robot-2]: process started with pid [19770]
[webots_tcp_client-1] WARNING: Unable to start Webots. Please start the local simulation server on your host machine. Next connection attempt in 1 second.
[webots_controller_my_robot-2] Cannot connect to Webots instance, retrying for another 50 seconds...
[webots_tcp_client-1] WARNING: Unable to start Webots. Please start the local simulation server on your host machine. Next connection attempt in 1 second.
[webots_tcp_client-1] WARNING: Unable to start Webots. Please start the local simulation server on your host machine. Next connection attempt in 1 second.
System
Webots Version: R2023b
ROS Version: Humble
Operating System:
Host: macOS Sonoma Version 14.2.1
Guest: Ubuntu Dev Container with ROS Humble installed
Graphics Card: Apple M2 GPU
Additional context
I assume there are Docker routing issues that prevents the ROS nodes (running on the guest) from connecting to the local server (running on the host). I confirmed there are no macOS firewall settings preventing a connection.
Describe the Bug
The
webots_ros2_driver
node running in a Docker container does not connect to the local simulation server running on a macOS host. Thewebots_tcp_client
never connects, so it never starts Webots. Thewebots_controller
instance is also unable to connect, presumably because Webots never actually launches.Steps to Reproduce
local_simulation_server.py
script on the hostlocal_simualtion_server.py
scriptros2 launch my_package robot_launch.py
Expected behavior The
WebotsLauncher
andWebotsController
instances launched on the guest should connect with the simulation server running on the host, and the Webots simulation app should launch. Thewebots_ros2_driver
should connect to the spawned robot.Affected Packages List of affected packages:
webots_ros2_driver
Screenshots Here's a printout snippet of the actual behavior when invoking
System
Additional context
I assume there are Docker routing issues that prevents the ROS nodes (running on the guest) from connecting to the local server (running on the host). I confirmed there are no macOS firewall settings preventing a connection.