Selecting and Configuring Gazebo Classic’s Physics Engine
Select ODE, Bullet, or Simbody in Gazebo Classic via the <physics type='...'> element, then verify engine choice and tune step size and solver iterations for stable simulation.
12 Mar 2026, 03:38 UTC

Selecting and Configuring Gazebo Classic’s Physics Engine
The quick way to choose ODE as the physics engine in Gazebo Classic is to set the type attribute of the <physics> element to ode and add the engine‑specific parameters inside the matching child block.
Mechanism
In a world SDF file the <physics> element defines global stepping behavior. Its type attribute selects the engine; only the nested elements that match the chosen engine are read. For example:
<physics type='ode'>
<max_step_size>0.001</max_step_size>
<real_time_update_rate>1000</real_time_update_rate>
<ode>
<solver>
<type>quick</type>
<iters>50</iters>
</solver>
</ode>
</physics>
This configuration runs ODE with a 1 ms step size and 50 solver iterations per step, giving a stable contact simulation for many robotics scenarios.
Engine trade‑offs
ODE is the classic default, fast for dense contact scenes but limited to sequential impulse solving. Bullet adds continuous collision detection and softer joint handling at a modest speed cost. Simbody focuses on high‑precision articulated dynamics, requiring more CPU time. The choice therefore balances fidelity against real‑time performance.
Common pitfalls
- Re‑tuning
max_step_sizeand solver iteration counts after switching engines; a setting stable for ODE may cause instability in Bullet or Simbody. - Not all joint types, constraints, or actuator models are supported across engines; verify that the world’s joints are compatible before porting.
- Plugins that assume ODE‑specific contact callbacks can crash when the world is run with Bullet or Simbody; test any custom code under the target engine.
- Engine availability depends on the Gazebo version and build; Classic is end‑of‑life, while newer Gazebo uses a DART‑based plugin instead of the
typeattribute.
Verification steps
- Confirm your Gazebo version. Run
gazebo --versionfor Classic orgz sim --versionfor the newer stack. The output tells you which selection mechanism applies. - Create a minimal world file (e.g.,
minimal.world) containing the ODE configuration shown above. Save it to/home/user/worlds/minimal.world. - Launch Gazebo Classic:
gazebo /home/user/worlds/minimal.world. In the console output you should see a line such as “Physics engine: ode”. The GUI world panel also lists the active engine. - Change the
typeattribute tobullet(orsimbody), edit the file, save, and restart Gazebo. Verify the startup log reports “Physics engine: bullet” (or “simbody”). - Run the same world under each engine and compare metrics: real‑time factor, contact stability, and joint jitter. Use
gz stats(new Gazebo) or the console printout to capture the real‑time factor.
Practical limits
The max_step_size sets the largest integration step; larger values increase speed but may cause missed collisions. The real_time_update_rate defines how often the simulation steps per second; it should match the host’s CPU capability for stable real‑time performance. Solver iteration count (iters) influences accuracy; too few iterations can produce unrealistic contact forces, especially in high‑speed scenes.
Editing the world file safely
Use a plain‑text editor with UTF‑8 support and keep a backup copy of the original SDF file before making changes. Typical permission requirement is write access to the directory containing the world file; on Linux you may need chmod u+w or run the editor with appropriate privileges if the file resides in a system‑wide path.
Performance monitoring in real time
While the simulation runs, Gazebo Classic prints a real‑time factor (RTF) in the console. An RTF close to 1.0 means the simulation keeps up with wall‑clock time. If RTF drops below 1.0, consider reducing max_step_size or lowering the solver iteration count. You can also enable the debug plugin to see per‑step timings, but this adds overhead.
Version‑specific notes
Gazebo Classic (versions 9 and 11) implements the type attribute as described. Newer Gazebo (formerly Ignition) no longer reads this attribute; instead you declare a physics plugin such as gz-physics in the world SDF and set its ode, bullet, or simbody parameters via the plugin’s configuration. Because the old mechanism is deprecated, worlds created for Classic may need adaptation when migrated to the newer stack.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.