Skip to content

Instantly share code, notes, and snippets.

@MarcoDotIO
Created April 16, 2026 03:43
Show Gist options
  • Select an option

  • Save MarcoDotIO/ae652a9ef184a550cb413e3719999cc8 to your computer and use it in GitHub Desktop.

Select an option

Save MarcoDotIO/ae652a9ef184a550cb413e3719999cc8 to your computer and use it in GitHub Desktop.
Install Gazebo 11 for both ARM and x86 Machines (ROS2 Jazzy, Ubuntu 24.04)
#!/usr/bin/env bash
set -e
echo "=== Gazebo (Harmonic) Installation for ROS 2 Jazzy (Ubuntu 24.04) ==="
ARCH=$(dpkg --print-architecture)
echo "Detected architecture: $ARCH"
# --- 1. Validate OS ---
if ! grep -q "24.04" /etc/os-release; then
echo "ERROR: This script requires Ubuntu 24.04 (Noble)."
exit 1
fi
# --- 2. Prerequisites ---
echo "[1/5] Installing prerequisites..."
sudo apt update
sudo apt install -y curl gnupg lsb-release
# --- 3. Ensure ROS 2 Jazzy is installed ---
if [ ! -f /opt/ros/jazzy/setup.bash ]; then
echo "ERROR: ROS 2 Jazzy not found. Install ROS 2 first."
exit 1
fi
source /opt/ros/jazzy/setup.bash
# --- 4. Install Gazebo Harmonic (UNIFIED for ARM + x86) ---
echo "[2/5] Installing Gazebo Harmonic via ROS integration..."
sudo apt update
sudo apt install -y ros-jazzy-ros-gz
# Optional but useful for robotics stacks
echo "[3/5] Installing optional simulation integrations..."
sudo apt install -y \
ros-jazzy-gz-ros2-control \
ros-jazzy-gz-ros2-control-demos || true
# --- 5. Environment setup ---
echo "[4/5] Setting up environment..."
if ! grep -q "source /opt/ros/jazzy/setup.bash" ~/.bashrc; then
echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
fi
# Gazebo resource paths (important for models/plugins)
if ! grep -q "GZ_SIM_RESOURCE_PATH" ~/.bashrc; then
echo "export GZ_SIM_RESOURCE_PATH=/usr/share/gz" >> ~/.bashrc
fi
exec $SHELL
# --- 6. Verification ---
echo "[5/5] Verifying installation..."
echo "ROS_DISTRO: $ROS_DISTRO"
gz sim --versions || true
echo ""
echo "=== Installation Complete ==="
echo "Run: gz sim"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment