Skip to content

docs: add ROS2 + Gazebo Docker bridge setup guide for harmonic, ionic…#682

Open
Not-NeoN-sup wants to merge 5 commits intogazebosim:masterfrom
Not-NeoN-sup:add-docker-bridge-docs
Open

docs: add ROS2 + Gazebo Docker bridge setup guide for harmonic, ionic…#682
Not-NeoN-sup wants to merge 5 commits intogazebosim:masterfrom
Not-NeoN-sup:add-docker-bridge-docs

Conversation

@Not-NeoN-sup
Copy link
Copy Markdown

🎉 New feature

Summary

Adds a setup guide for running ROS2 and Gazebo in separate Docker containers
connected over a custom Docker network using ros_gz_bridge. Covers network
setup, IP configuration, bridge setup and verification.

Added for: harmonic, ionic, jetty, garden

Test it

Follow the steps in ros2_gz_docker_bridge.md and verify with ros2 topic echo /clock

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed
  • All tests passed
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits.

Generated-by: Claude (Anthropic) (minor corrections only)

Closes #gazebosim/ros_gz#725

…, jetty, garden

Signed-off-by: Not-NeoN-sup <gautamuknown@gmail.com>
Copy link
Copy Markdown
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! This looks great. I have followed the instructions locally and the bridge works as described. I just have a few minor comments.

However, while this works across two containers, the issue in gazebosim/ros_gz#725 is about Gazebo running on the host and ROS 2 running in a container. So we should keep that issue open.

Comment thread garden/ros2_gz_docker_bridge.md Outdated
@@ -0,0 +1,174 @@
# ROS2 + Gazebo Docker Bridge
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "ROS 2" (with a space), here and elsewhere.

Comment thread garden/ros2_gz_docker_bridge.md Outdated

- Docker installed and running
- Both images built:
- `gazebo` — from `dockerfile.gazebo`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is dockerfile.gazebo supposed to be a file included in this tutorial?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes docker image for gazebo i have specified as docker.gazebo same for ros as docker.ros

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ros2 below says "from your ROS2 Dockerfile", which is fine, but putting dockerfile.gazebo makes it look like the tutorial should provide that file, but I don't see that in this PR.

Comment thread garden/ros2_gz_docker_bridge.md Outdated
source /opt/ros/<ros-distro>/setup.bash
```

> Add these to `~/.bashrc` in each container to be available across sessions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you emphasize this more since the commands below won't work without it? You can use an admonition like so

Suggested change
> Add these to `~/.bashrc` in each container to be available across sessions.
:::{important}
Add these to `~/.bashrc` in each container to be available across sessions.
:::

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok ill make the changes

Comment thread garden/ros2_gz_docker_bridge.md Outdated
Comment on lines +167 to +174
## Final Network Info

| Container | IP | Role |
|---|---|---|
| `gazebo-container` | `<gz-ip>` | Runs Gazebo simulation |
| `ros2-container` | `<ros-ip>` | Runs ROS2 + bridge |

Network name: `ros-link` No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary

Comment thread garden/tutorials.md Outdated
* [ROS 2 Integration](ros2_integration)
* [ROS 2 Interoperability](ros2_interop)
* [ROS 2 Integration Template](ros_gz_project_template_guide)
* [ROS 2 Docker Bridge Setup](ros2_gz_docker_bridge)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is specifically addressing cross-container communuication, the title should indicate that.

"Containers": {
"281b3cbfba6a...": {
"Name": "ros2-container",
"IPv4Address": "172.21.0.3/16" //<ros-ip>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subnet mask (/16) would need to be removed before setting GZ_IP. Can you add a statement or example about that?

Comment on lines +134 to +139
```bash
docker exec -it ros2-container bash
source /opt/ros/<ros-distro>/setup.bash
ros2 run ros_gz_bridge parameter_bridge \
/clock@rosgraph_msgs/msg/Clock@gz.msgs.Clock
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should clarify that this step is not needed if using the yaml method mentioned above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@github-project-automation github-project-automation Bot moved this from Inbox to In review in Core development Apr 30, 2026
@caguero
Copy link
Copy Markdown
Contributor

caguero commented May 7, 2026

@Not-NeoN-sup , there are some conflicts to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants