Week 3-4: Gazebo basics
This is how far we will get by the end of this lesson:

Table of Contents
- What is Gazebo
-
Install Gazebo
2.1. Run Gazebo examples
- Download ROS package
-
Creating a Gazebo world
4.1. Launch Gazebo world from ROS
-
URDF
5.1. Building our robot 1
5.2. View the robot in RViz
5.3. Building our robot 2
5.4. TF Tree
5.5. Add some colors
5.6. Load the URDF in Gazebo
-
Gazebo integration
6.1. Diff drive plugin
6.2. ROS gz bridge
6.3. Driving around
6.4. Odometry and Trajectory server
- 3D models
- Skid steer
- Mecanum wheel
What is Gazebo
Gazebo is a powerful robotics simulation tool that provides a 3D environment for simulating robots, sensors, and objects. It is widely used in the ROS ecosystem for testing and developing robotics algorithms in a realistic virtual environment before deploying them to real hardware.
Gazebo integrates tightly with ROS, enabling simulation and control of robots using ROS topics, services, and actions. In ROS2 with the latest Gazebo releases the integration is facilitated by ros_gz
.
Key Features of Gazebo:
- 3D Physics Engine:
Simulates rigid body dynamics, collision detection, and other physics phenomena using engines like ODE, Bullet, and DART.
- Realistic Sensors:
Simulates cameras, LiDAR, IMUs, GPS, and other sensors with configurable parameters.
- Plugins:
Extensible via plugins to control robots, customize physics, or add functionality.
- Worlds and Models:
Enables users to create complex environments with pre-built or custom objects and robots.
Besides Gazebo, there are many alternative simulation environments for ROS, but usually the setup of these simulators are more complicated and less documented. Certain simulators also have very high requirements for the GPU.
Simulator |
Best For |
Advantages |
Disadvantages |
Gazebo |
General robotics simulation in ROS |
Free, accurate physics, ROS support |
Moderate visuals, resource-heavy |
Unity |
High-fidelity visuals and AI/ML tasks |
Realistic graphics, AI tools |
Steep learning curve, not robotics-specific |
Webots |
Beginner-friendly robotics simulation |
Easy setup, cross-platform |
Limited graphics, less customizable |
Isaac Sim |
High-end AI and robotics simulation |
High-fidelity physics, AI support |
GPU-intensive, complex setup |
Install Gazebo
Before we install Gazebo we have to understand the compatibility between Gazebo versions and ROS distributions.
ROS Distribution |
Gazebo Citadel (LTS) |
Gazebo Fortress (LTS) |
Gazebo Garden |
Gazebo Harmonic (LTS) |
Gazebo Ionic |
ROS 2 Rolling |
❌ |
❌ |
⚡ |
⚡ |
✅ |
ROS 2 Jazzy (LTS) |
❌ |
❌ |
⚡ |
✅ |
❌ |
ROS 2 Iron |
❌ |
✅ |
⚡ |
⚡ |
❌ |
ROS 2 Humble (LTS) |
❌ |
✅ |
⚡ |
⚡ |
❌ |
ROS 2 Foxy (LTS) |
✅ |
❌ |
❌ |
❌ |
❌ |
ROS 1 Noetic (LTS) |
✅ |
⚡ |
❌ |
❌ |
❌ |
Since we use the latest LTS ROS2 distribution, Jazzy, we need Gazebo Harmonic.
To install Gazebo Harmonic binaries on Ubuntu 24.04 simply follow the steps on this link.
File truncated at 100 lines see the full file