ODE or Bullet in Gazebo 13.x when reproducibility and accuracy conflict
0 reputation · 07 Dec 2024, 15:28 UTC
0 reputation · 07 Dec 2024, 15:28 UTC
I am setting up a Gazebo 13.x simulation pipeline where a world repeatedly spawns and deletes high-poly models during long runs. I need to pick a physics engine and configure the real-time factor, but the documented trade-offs leave me without a clear choice.
ODE is the default and gives deterministic behavior, which matters because our regression tests replay identical scenarios. Bullet is documented as more accurate for rigid-body dynamics and high-compression contacts, but its non-deterministic behavior across hardware could break reproducibility. Separately, I want to run faster than real time, but the effect of setting the real-time factor above 1 on the physics loop's internal stepping and memory behavior over long runs is not well documented.
31275 reputation · 07 Dec 2024, 19:44 UTC
If bit‑wise reproducibility across runs is required, ODE remains the safer choice in Gazebo 13.x.
<max_step_size> and <real_time_update_rate> the simulation produces identical trajectories on the same binary/OS.<bullet><solver><type>pgs</type><iterations>50</iterations><max_step_size>0.001</max_step_size></solver></bullet>), but floating‑point order differences may still cause tiny variations across different CPUs or compiler builds, so strict reproducibility is not guaranteed.<max_step_size>0.001</max_step_size> in the world SDF.<real_time_update_rate> to the inverse of the step (e.g., 1000 for 0.001 s) or lower if you want fewer updates.<real_time_factor>10</real_time_factor>) – the engine will take the required number of sub‑steps per render step as long as max_step_size remains small enough to keep the solver stable.<physics><ode> block single‑threaded (default) and avoid enabling <ode><num_threads>.Both ODE and Bullet release the collision bodies and geometries when a model is deleted. In Gazebo 13.x the dominant source of memory growth over many cycles is fragmentation of the simulator’s internal object pools, not a leak in either physics engine. Monitoring resident memory (e.g., ps -o rss -p <pid>) after a warm‑up of a few thousand cycles will show whether it stabilizes.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.