LESSON 10 · SIMULATION

Build a simulation you can explain

Understand physics, clocks, bridges and controllers.

Environment and verification

Documented target: Ubuntu 24.04 · ROS 2 Jazzy · Gazebo Harmonic where used. Browser labs tested; ROS/Ubuntu/hardware execution not performed here.

What you will understand

  • Separate ROS and simulator responsibilities.
  • Launch an empty world.
  • Check interfaces and clocks.

Prerequisites: Describe geometry and connect frames and its stated environment.

The idea, made clear.

Gazebo supplies worlds, rigid-body physics and simulated sensors. ROS nodes use ROS interfaces. A bridge translates selected messages; it does not expose every simulator value automatically. Pin versions and inspect the bridge configuration.

ros2_control separates controller behavior from hardware interfaces. Simulation may implement those interfaces without physical motors. Joint names, command interfaces and state interfaces must agree with the robot description and controller setup.

Mass and inertia matter. Missing or invalid inertial properties can cause unstable physics. Start with low speed and a simple world before adding autonomy. A controller that works in an ideal simulator is not automatically safe on hardware.

ROS commandBridge/interfacePhysics modelSimulated state
An original overview of the information or commissioning sequence.

Try it, step by step.

1

Install the compatible integration

After the official ROS repository setup, install the distribution pairing.

simulation-and-control-1.txt
sudo apt install ros-jazzy-ros-gz
ros2 launch ros_gz_sim gz_sim.launch.py gz_args:="-r empty.sdf"

Expected: An empty Gazebo world; requires a graphical environment.

2

Inspect clocks

A bridge must be configured; do not assume /clock exists.

simulation-and-control-2.txt
ros2 topic list
# When bridged:
ros2 topic echo /clock --once

Expected: A simulation timestamp when the clock bridge is active.

3

Check controllers

Compare joint and interface names before activating a custom controller.

Expected: Matching interfaces and bounded commands.

Explore the interactive lab →

If something goes wrong

Simulator crashes
Review GPU/VM support and documented headless options.
Controller cannot activate
Inspect required interfaces and lifecycle messages.

Check your understanding

What does the bridge translate?

Make it yours

Document world, bridge topics, clock source and controlled joints.

Your learning progress

Optional progress stays in this browser. No account needed.

Go to the source documentation

Commands are educational examples for the stated environment, not a transcript of local ROS execution. Verify actual behavior on your machine.

Look up a term · Version notes · Report an issue