Simulating a robot using Gazebo Sim
Here is an example of a Gazebo simulation that does not use ROS 2 components. You can find the SDF file in Chapter05/moving_robot.sdf
. The SDF file format is very similar to URDF. Both are used to represent the 3D robot model. SDF is the format for simulation in Gazebo. To interface ROS 2 and Gazebo, we usually convert the URDF/Xacro files to SDF format and start the simulation.
The example sdf
file represents a differential drive robot. To start the simulation, you can open a terminal, switch the path to the sdf
file path, and execute the following command:
gz sim moving_robot.sdf
We can mention the sdf
file and the gz sim
command to start the simulation. After seeing the Gazebo Sim window, press the Play button in the bottom-left corner to start the simulation. Figure 5.5 shows the simulation output of the above command.

Figure 5.5: Gazebo Sim with differential drive robot simulation
Gazebo GUI
The GUI we...