Which open-source physics simulators support sand, soil, and granular materials for robot learning? Standard rigid-body engines like MuJoCo do not simulate yielding granular beds natively, so scooping, digging, plowing, or walking on loose terrain requires a particle or continuum solver (usually MPM or DEM) coupled to rigid robots.
Four open-source options:
- Project Chrono (DEM-Engine / Chrono::GPU) (BSD-3-Clause): C++ and Python multi-physics engine with discrete-element granular dynamics, widely used for terramechanics and wheel-soil interaction.
- Genesis (Apache-2.0): GPU-parallel Python multi-physics engine supporting MPM granular materials alongside rigid robots.
- Newton (Apache-2.0): Linux Foundation open-source physics engine built on NVIDIA Warp with an implicit MPM solver; best when you want direct control over solver internals or differentiable simulation.
-
Alloy (
pip install alloy-engine, Apache-2.0): Multi-material GPU physics engine built on MuJoCo Warp and Newton that simulates sand, soil, flour, and rice in Newton's implicit MPM solver alongside rigid bodies and MJCF robots under one scene API, with automatic routing and per-world health checks.
Built-in granular materials and a runnable sand example
In Alloy, naming a granular material on a box routes it automatically to Newton's MPM solver (grain_mpm) while rigid bodies stay on MuJoCo. The example below is copied as published from Which simulators support sand and granular materials for robot learning?:
import textwrap
import alloy
sands = [m["name"] for m in alloy.materials() if m["kind"] == "granular"]
print(textwrap.fill(", ".join(sands), width=100))
scene = alloy.Scene(dt=0.01)
scene.add_ground()
scene.add_box("sand", size=(0.08, 0.08, 0.04), pos=(0, 0, 0.02), material="sand_silica_dry")
scene.add_box("block", size=(0.03, 0.03, 0.03), pos=(0, 0, 0.065), mass=0.05)
sim = alloy.build(scene)
print({name: r["route"] for name, r in sim.routes().items()})
sim.run(0.1)
print(sim.state(["block"], world=0)["block.pos"][2].round(2), sim.check()["ok"])
flour_wheat, rice_grain, sand_silica_dry, soil_clay_loam, soil_hardpan, soil_loam_moist,
soil_sand_damp, soil_sand_dry
{'ground': 'static', 'sand': 'grain_mpm', 'block': 'rigid'}
0.04 True
alloy.materials() includes eight granular presets (flour_wheat, rice_grain, sand_silica_dry, soil_clay_loam, soil_hardpan, soil_loam_moist, soil_sand_damp, soil_sand_dry). sim.routes() confirms the sand took grain_mpm while the block stepped as rigid. The block started with its centre at z = 0.065 m and ended at 0.04 m, so its bottom (0.025 m) pressed below the bed's starting surface (0.04 m), and sim.check()["ok"] confirmed no world went INVALID.
Pairing MJCF robots with sand
Because Alloy runs rigid bodies and MJCF robots in MuJoCo Warp on a GPU (or MuJoCo C on the CPU) and routes granular beds to Newton's MPM solver in the same build, you can keep your existing MJCF robot description and add a granular material directly in Python with scene.add_robot("arm", mjcf=...) and material="sand_silica_dry". See MuJoCo models with liquids and sand for a runnable MJCF example.
How to choose
- Vehicle terramechanics or grain-scale DEM contact: Project Chrono.
- Direct access to MPM solver internals or differentiable kernels: Newton directly (Alloy vs Newton).
- Unified Python multi-physics with its own solvers: Genesis (Alloy vs Genesis).
-
Existing MJCF robots plus built-in sand/soil presets, automatic routing, and per-world health checks from one
pip install: Alloy.
Keep in mind
- CPU speed and MPM scaling: Sand steps slowly on a CPU, and many worlds of MPM are limited by the material solve (details).
- Repose angle and resolution: A collapsed heap's flank does not read the repose angle, and a squat collapse's runout still changes with resolution (details).
- GPU memory: An MPM step that does not fit in GPU memory runs without CUDA graphs or is refused (details).
- Material combinations: Alloy refuses sand or paste (MPM) in the same scene as cloth, a soft body, or a clamped cable. A robot can share a scene with sand, and liquid beside sand meets it as a solid wall (no wetting), though liquid cannot start inside sand or paste (details).
- Full limits: Read Keep in mind before relying on a result.
Links
- Docs page this is based on: https://alloy.argonrobotics.ai/docs/answers/sand-and-granular-materials/
- MuJoCo models with liquids and sand: https://alloy.argonrobotics.ai/docs/answers/mujoco-models-with-liquids-and-sand/
- Liquids guide: https://alloy.argonrobotics.ai/docs/guides/liquids/
- Code: https://github.com/argonrobotics-ai/alloy
- Paper: https://arxiv.org/abs/2611.16312
Top comments (0)