docs: add ROS2 + Gazebo Docker bridge setup guide for harmonic, ionic…#682
docs: add ROS2 + Gazebo Docker bridge setup guide for harmonic, ionic…#682Not-NeoN-sup wants to merge 5 commits intogazebosim:masterfrom
Conversation
…, jetty, garden Signed-off-by: Not-NeoN-sup <gautamuknown@gmail.com>
azeey
left a comment
There was a problem hiding this comment.
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.
| @@ -0,0 +1,174 @@ | |||
| # ROS2 + Gazebo Docker Bridge | |||
There was a problem hiding this comment.
nit: "ROS 2" (with a space), here and elsewhere.
|
|
||
| - Docker installed and running | ||
| - Both images built: | ||
| - `gazebo` — from `dockerfile.gazebo` |
There was a problem hiding this comment.
Is dockerfile.gazebo supposed to be a file included in this tutorial?
There was a problem hiding this comment.
yes docker image for gazebo i have specified as docker.gazebo same for ros as docker.ros
There was a problem hiding this comment.
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.
| source /opt/ros/<ros-distro>/setup.bash | ||
| ``` | ||
|
|
||
| > Add these to `~/.bashrc` in each container to be available across sessions. |
There was a problem hiding this comment.
Can you emphasize this more since the commands below won't work without it? You can use an admonition like so
| > 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. | |
| ::: |
| ## 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 |
There was a problem hiding this comment.
I don't think this is necessary
| * [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) |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
The subnet mask (/16) would need to be removed before setting GZ_IP. Can you add a statement or example about that?
| ```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 | ||
| ``` |
There was a problem hiding this comment.
You should clarify that this step is not needed if using the yaml method mentioned above.
|
@Not-NeoN-sup , there are some conflicts to resolve. |
🎉 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.mdand verify withros2 topic echo /clockChecklist
codecheckpassedGenerated-by: Claude (Anthropic) (minor corrections only)
Closes #gazebosim/ros_gz#725