How can I access Gazebo topics from a ROS 2 environment inside a Docker container when the Gazebo simulation is running on the host machine or in a separate Docker container? Is this theoretically possible, and if so, what is the recommended approach?
Current Setup:
- Gazebo Simulation: Running on the host machine or in a separate Docker container.
- ROS 2 Environment: Running inside a Docker container using
--network host
. - Bridge Tool:
ros_gz_bridge
is configured on both systems.
Steps Taken:
- Launched the Gazebo simulation on the host or in a separate container.
- Started the Docker container with the ROS 2 setup.
- Attempted to bridge Gazebo topics into the ROS 2 environment using
ros_gz_bridge
.
Challenges Faced:
- Gazebo topics are not visible in the ROS 2 Docker container.
- Unclear how to establish a connection between Gazebo and ROS 2 across container boundaries or between host and container.
Question:
Is it theoretically possible to access Gazebo topics from a Docker container when the Gazebo simulation is running on the host or in another container? If so, what is the recommended method or configuration to achieve this? Are there specific networking or bridge settings required for ros_gz_bridge
to work across these boundaries?
Environment Details:
- Operating System: Ubuntu 22.04
- ROS 2 Version: Humble
- Gazebo Version: Gz Harmonic
- Docker Version: 28.0.4
Thanks for any help. I look forward to any suggestions, documentation references, or guidance on this topic.