Heuristic:Google deepmind Dm control Prop Settling Physics Tuning
| Knowledge Sources | |
|---|---|
| Domains | Physics_Simulation, Manipulation, Debugging |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
Tuning guide for physics settling parameters and rejection sampling in the PropPlacer initializer, used to place objects at stable resting positions in Composer environments.
Description
The `PropPlacer` initializer places props (objects) at randomized positions with optional collision avoidance and physics settling. "Settling" means stepping the physics simulation until the prop reaches a stable resting state (velocity and acceleration below threshold). If settling fails -- due to tight collision constraints, unstable configurations, or insufficient time -- the placement is rejected and resampled. Understanding the settling tolerances and rejection sampling parameters is essential for reliable environment initialization.
Usage
Apply this heuristic when props fail to initialize (error: "Failed to settle physics"), when manipulation tasks have unreliable resets, or when designing custom prop placement with collision constraints.
The Insight (Rule of Thumb)
- Settling Tolerances (empirically tuned):
- Velocity threshold: `_SETTLE_QVEL_TOL = 1e-3` (max joint velocity for "settled")
- Acceleration threshold: `_SETTLE_QACC_TOL = 1e-2` (max joint acceleration for "settled")
- Key Parameters to Tune:
- `max_settle_physics_time` (default 2.0s): Maximum simulation time for settling. Increase for heavy or complex objects.
- `max_settle_physics_attempts` (default not specified): Number of retry attempts per prop.
- `max_attempts_per_prop` (default 20): Maximum rejection sampling attempts before giving up.
- Contact Buffer Trick: During multi-prop placement, unplaced props have contacts temporarily disabled to free up MuJoCo's contact buffer and prevent premature `PhysicsError` from buffer overflow.
- Trade-off: Higher settling time/attempts increases initialization reliability but slows down environment resets. For RL training with many resets per second, keep settling parameters minimal.
Reasoning
The settling tolerances (1e-3 velocity, 1e-2 acceleration) are empirically determined to balance between "truly stable" and "close enough for RL". Tighter tolerances would reject many valid placements where minor vibrations persist. Looser tolerances risk initializing in unstable configurations that collapse during the first step.
The contact buffer trick is a key optimization: MuJoCo has a fixed-size contact buffer, and placing many props simultaneously can overflow it. By disabling contacts for unplaced props, each placement only contends with already-placed props and the arena, drastically reducing buffer usage.
Code evidence from `composer/initializers/prop_initializer.py:29-32`:
_SETTLE_QVEL_TOL = 1e-3
_SETTLE_QACC_TOL = 1e-2
Contact buffer management from `composer/initializers/prop_initializer.py:179-182`:
# Temporarily disable contacts for props not yet placed to free up space
# in contact buffer, avoiding premature PhysicsError
Rejection sampling on collision from prop_initializer.py (approximate):
# If collisions detected with dist <= 0, pose rejected and resampled
# Full contact buffer -> PhysicsError -> pose rejected and resampled