Skip to main content
This page explains how Gazebo simulation worlds are structured, introduces the SDF and Xacro file formats, and walks through the AWS RoboMaker Small House world used in the TurtleBot3 demos.

Prerequisites


The SDF world file format

Simulation Description Format (SDF) is the XML schema used by Gazebo to describe simulation worlds. Every world file has the following top-level structure:

Plugins

Gazebo Sim (Harmonic) is plugin-based. Each capability, physics, sensors, scene rendering, is a loadable shared library declared in the world file:
gz-sim-scene-broadcaster-system is only loaded when the simulation is not running headless. The Small House world uses an Xacro argument to control this:

Physics

The <physics> element configures the ODE (Open Dynamics Engine) solver. The Small House world uses a 3 ms time step:
A smaller time step improves simulation accuracy at the cost of computational load. For navigation tasks with a TurtleBot, 3 ms is a good balance.

Lighting

Gazebo supports directional, point, and spot lights. The Small House world uses a single directional sun:
The <direction> vector (-0.5, 0.1, -0.9) angles the light from upper-left, creating natural shadow contrast on furniture.

Xacro: parameterized world files

Xacro (XML Macros) extends plain SDF with:
  • Arguments, pass parameters when loading the world
  • Conditionals, <xacro:if> / <xacro:unless> for optional blocks
  • Macros, reusable XML templates with local variables
World files that use Xacro carry the .sdf.xacro extension. To process them, ROS 2 runs the Xacro preprocessor at launch time, producing a pure SDF file that Gazebo can load. The Small House world declares one argument:
The launch file passes this argument when spawning the world:

Model anatomy

Every Gazebo model lives in its own directory with two required files:

model.config

model.sdf

A static furniture model needs three things: inertial properties, a collision shape for physics, and a visual mesh for rendering. Here is the complete ChairA_01 model:
The collision mesh is deliberately simpler than the visual mesh, fewer polygons mean faster contact detection. For furniture that the robot will not physically interact with (static obstacles), a convex hull approximation is sufficient.

The AWS RoboMaker Small House world

The Small House world is a residential interior adapted from AWS RoboMaker’s open-source assets. It contains 68 aws_robomaker_residential_* models covering:

Placing models in the world

Each model is placed with a <model> block in the world file. The <include> element references the model directory by name; <pose> gives its position (x, y, z) and orientation (roll, pitch, yaw in radians):
Setting <static>true</static> tells Gazebo the model does not move, the physics engine skips dynamics for it, saving computation.

Launching the house world

Gazebo will open showing the residential interior. The TurtleBot spawns near the entrance. The house world ships with a pre-built Nav2 occupancy grid map at 5 cm/px resolution (tb_worlds/maps/house_world_map.yaml). The map was generated by running GMapping SLAM in the world and recording the result. When a new model is added or furniture is rearranged, the map must be regenerated, Nav2 will plan routes through walls it does not know about.

Available worlds

The turtlebot-maze project includes four Gazebo environments: All worlds use the same Docker images and behavior demo services, only the world service name changes.

Key SDF elements reference