tags: #osx #macos #arm #arm64 #docker #gazebo #ros2 #ros
(For Mac + ARM/M1/M2/M3/M4)
Both the (Official ROS Docker images)[https://hub.docker.com/_/ros] and osrf/ros images are do not always have the latest version of Gazebo or support for arm platforms. Official Docker images for ROS2 are available at: https://hub.docker.com/r/osrf/ros/tags/
Offical images: https://hub.docker.com/_/ros
[https://hub.docker.com/_/ros](Official ROS Docker images)
[https://github.com/osrf/docker_images/blob/master/ros/jazzy/ubuntu/noble/simulation/Dockerfile](Source Dockerfile)
This is the vairation of ROS2 that is installed
docker pull osrf/ros:jazzy-simulation
Better repo for ROS2 images: https://github.com/sloretz/ros_oci_images
I was unable to get the Gazebo GUI (or rviz2) to work on MacOS with x11 forwarding enabled using xQuartz. https://medium.com/@viirya/setting-up-linux-gui-container-on-mac-728194b20e78
See example Dockerfile in this gist:
Build the image (See Dockerfile for details):
docker build -t gazebo-vnc:jazzy .
Launch Docker container:
docker run -d --rm -p 5900:5900 gazebo-vnc:jazzy
docker exec -it <CONTAINER_ID> bash
Quickly launch built in MacOS VNC client:
open "vnc://localhost:5900"
Test with:
gz sim shapes.sdf
https://gazebosim.org/docs/latest/ros2_integration/
On the host machine:
brew tap osrf/simulation
brew install <your_version> # e.g. brew install gz-harmonic (See below to match your ROS2 version)
# ROS2 Rolling = gz-iconic
# ROS2 Jazzy = gz-harmonic (*Tested & Working*)
# ROS2 Humble & Iron = ignition-fortress
# ROS2 Foxy & Noetic = ignition-citadel
Note: This takes a while to install.