BaseCodeByte
GZ

Gazebo Lessons

Learn Gazebo for robotics simulation with ROS integration, URDF and SDF modeling and robot spawning.

Course outline

Tracks and lessons

Track 01beginner

Module 1: Beginner - Foundations

Learn Gazebo for robotics simulation with ROS integration, URDF and SDF modeling, robot spawning.

01Introduction to Gazebo & ROS IntegrationIntroduction to Gazebo & ROS Integration Learn what Gazebo simulates, how its physics and sensors work, how Gazebo Classic differs from the newer Gazebo line, and how ROS nodes communicate with the simulation through topics, services, and plugins. Thbeginner

Introduction to Gazebo & ROS Integration Learn what Gazebo simulates, how its physics and sensors work, how Gazebo Classic differs from the newer Gazebo line, and how ROS nodes communicate with the simulation through topics, services, and plugins. Th

Example
// Gazebo and ROS integration mental model
// Gazebo world -> sensors -> plugins -> bridge -> ROS topics
#include <iostream>

int main() {
    std::cout << "/cmd_vel -> differential drive plugin" << std::endl;
    std::cout << "/scan -> lidar sensor stream" << std::endl;
    std::cout << "/joint_states -> simulated robot state" << std::endl;
    return 0;
}
Quiz

A key idea in Introduction to Gazebo & ROS Integration is:

A strong way to practice Introduction to Gazebo & ROS Integration is to:

Why does Introduction to Gazebo & ROS Integration matter in Gazebo work?

02Installing ROS + GazeboInstalling ROS + Gazebo Install ROS and Gazebo, verify the environment, and run a known world so the toolchain is proven before deeper robotics work begins. These lessons explain what Gazebo is, how it fits next. Gazebo is not only a 3D viewer. It isbeginner

Installing ROS + Gazebo Install ROS and Gazebo, verify the environment, and run a known world so the toolchain is proven before deeper robotics work begins. These lessons explain what Gazebo is, how it fits next. Gazebo is not only a 3D viewer. It is

Example
# Install ROS 2 and Gazebo
sudo apt install ros-humble-desktop
sudo apt install ros-humble-ros-gz

# Verify with a sample world
gz sim shapes.sdf
Quiz

A key idea in Installing ROS + Gazebo is:

A strong way to practice Installing ROS + Gazebo is to:

Why does Installing ROS + Gazebo matter in Gazebo work?

03URDF Basics (Robot Description)URDF Basics (Robot Description) Describe a robot with links, joints, visuals, collisions, inertials, and sensors so Gazebo has a robot model worth simulating. These lessons explain what Gazebo is, how it fits next. Gazebo is not only a 3D viewer. It beginner

URDF Basics (Robot Description) Describe a robot with links, joints, visuals, collisions, inertials, and sensors so Gazebo has a robot model worth simulating. These lessons explain what Gazebo is, how it fits next. Gazebo is not only a 3D viewer. It

Example
<robot name="demo_bot">
  <link name="base_link">
    <visual><geometry><box size="0.4 0.3 0.2"/></geometry></visual>
    <collision><geometry><box size="0.4 0.3 0.2"/></geometry></collision>
    <inertial><mass value="4.0"/></inertial>
  </link>
  <joint name="laser_joint" type="fixed">
    <parent link="base_link"/>
    <child link="laser_link"/>
  </joint>
</robot>
Quiz

A key idea in URDF Basics (Robot Description) is:

A strong way to practice URDF Basics (Robot Description) is to:

Why does URDF Basics (Robot Description) matter in Gazebo work?

Track 02beginner

Module 2: Intermediate - Worlds & Spawning

Learn Gazebo for robotics simulation with ROS integration, URDF and SDF modeling, robot spawning.

01SDF Basics (World & Model Description)SDF Basics (World & Model Description) Use SDF to describe worlds, simulation properties, and model-level details that go beyond a basic robot description. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDFbeginner

SDF Basics (World & Model Description) Use SDF to describe worlds, simulation properties, and model-level details that go beyond a basic robot description. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDF

Example
<sdf version="1.9">
  <world name="warehouse_world">
    <physics type="ode"/>
    <light name="sun" type="directional"/>
    <model name="ground_plane"/>
  </world>
</sdf>
Quiz

A key idea in SDF Basics (World & Model Description) is:

A strong way to practice SDF Basics (World & Model Description) is to:

Why does SDF Basics (World & Model Description) matter in Gazebo work?

02Spawning Robots in GazeboSpawning Robots in Gazebo Load a robot description into a running simulation, spawn the entity cleanly, and connect it to controllers. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDF usually describes thintermediate

Spawning Robots in Gazebo Load a robot description into a running simulation, spawn the entity cleanly, and connect it to controllers. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDF usually describes th

Example
# Spawn a robot described by URDF
ros2 run gazebo_ros spawn_entity.py \
  -entity demo_bot \
  -topic /robot_description

# Or launch with controllers
ros2 launch demo_bot_bringup sim.launch.py
Quiz

A key idea in Spawning Robots in Gazebo is:

A strong way to practice Spawning Robots in Gazebo is to:

Why does Spawning Robots in Gazebo matter in Gazebo work?

03ROS-Gazebo BridgeROS-Gazebo Bridge Bridge the simulation transport layer to ROS topics and services so commands and sensors move across the boundary correctly. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDF usually descintermediate

ROS-Gazebo Bridge Bridge the simulation transport layer to ROS topics and services so commands and sensors move across the boundary correctly. These lessons focus on the files and runtime steps that. URDF usually describes the robot, SDF usually desc

Example
# Example bridge mappings
ros2 run ros_gz_bridge parameter_bridge \
  /cmd_vel@geometry_msgs/msg/Twist@gz.msgs.Twist \
  /scan@sensor_msgs/msg/LaserScan@gz.msgs.LaserScan \
  /joint_states@sensor_msgs/msg/JointState@gz.msgs.Model
Quiz

A key idea in ROS-Gazebo Bridge is:

A strong way to practice ROS-Gazebo Bridge is to:

Why does ROS-Gazebo Bridge matter in Gazebo work?

Track 03intermediate

Module 3: Intermediate - Control, Sensors & Plugins

Learn Gazebo for robotics simulation with ROS integration, URDF and SDF modeling, robot spawning.

01Controlling RobotsControlling Robots Publish commands, subscribe to state, and build safe control loops that behave predictably in simulation. These lessons show how commands, sensors, plugins, and controller loops. A useful simulation is more than visuals. It must puintermediate

Controlling Robots Publish commands, subscribe to state, and build safe control loops that behave predictably in simulation. These lessons show how commands, sensors, plugins, and controller loops. A useful simulation is more than visuals. It must pu

Example
#include <chrono>
#include <iostream>

int main() {
    double cmdVel = 0.3;
    double maxVel = 0.5;
    bool emergencyStop = false;
    if (!emergencyStop && cmdVel <= maxVel) std::cout << "publish /cmd_vel" << std::endl;
    return 0;
}
Quiz

A key idea in Controlling Robots is:

A strong way to practice Controlling Robots is to:

Why does Controlling Robots matter in Gazebo work?

02Sensors & PluginsSensors & Plugins Attach realistic sensors and motion plugins so the robot can publish data and respond to actuators like a real platform. These lessons show how commands, sensors, plugins, and controller loops. A useful simulation is more than visuaintermediate

Sensors & Plugins Attach realistic sensors and motion plugins so the robot can publish data and respond to actuators like a real platform. These lessons show how commands, sensors, plugins, and controller loops. A useful simulation is more than visua

Example
<plugin name="diff_drive" filename="gz-sim-diff-drive-system">
  <left_joint>left_wheel_joint</left_joint>
  <right_joint>right_wheel_joint</right_joint>
  <topic>/cmd_vel</topic>
</plugin>

<sensor name="front_lidar" type="gpu_lidar"/>
Quiz

A key idea in Sensors & Plugins is:

A strong way to practice Sensors & Plugins is to:

Why does Sensors & Plugins matter in Gazebo work?

Track 04advanced

Module 4: Advanced - Advanced Navigation & Reuse

Learn Gazebo for robotics simulation with ROS integration, URDF and SDF modeling, robot spawning.

01Navigation & SLAM (Advanced)Navigation & SLAM (Advanced) Connect Nav2-style navigation, mapping, localization, and planning workflows to Gazebo so autonomous motion can be tested before hardware. These lessons connect Gazebo to navigation workflows and then turn. The goal is noadvanced

Navigation & SLAM (Advanced) Connect Nav2-style navigation, mapping, localization, and planning workflows to Gazebo so autonomous motion can be tested before hardware. These lessons connect Gazebo to navigation workflows and then turn. The goal is no

Example
# Launch simulated navigation
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=true
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=true

# Goal topics and maps can now be tested in Gazebo
Quiz

A key idea in Navigation & SLAM (Advanced) is:

A strong way to practice Navigation & SLAM (Advanced) is to:

Why does Navigation & SLAM (Advanced) matter in Gazebo work?

02Building Reusable Simulation SkillsBuilding Reusable Simulation Skills Turn the whole Gazebo workflow into reusable skills for spawning, bridging, sensors, and control so future robot projects start faster and with fewer mistakes. These lessons connect Gazebo to navigation workflows aadvanced

Building Reusable Simulation Skills Turn the whole Gazebo workflow into reusable skills for spawning, bridging, sensors, and control so future robot projects start faster and with fewer mistakes. These lessons connect Gazebo to navigation workflows a

Example
// Reusable Gazebo workflow checklist
#include <iostream>
#include <vector>

int main() {
    std::vector<const char*> skills = {"spawn robots", "bridge topics", "integrate sensors", "run safe control loops"};
    for (const auto* skill : skills) std::cout << skill << std::endl;
    return 0;
}
Quiz

A key idea in Building Reusable Simulation Skills is:

A strong way to practice Building Reusable Simulation Skills is to:

Why does Building Reusable Simulation Skills matter in Gazebo work?