Principle:Isaac sim IsaacGymEnvs Randomization State Initialization
| Knowledge Sources | |
|---|---|
| Domains | |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Process of modifying simulation physics properties per environment according to randomization parameter specifications. This principle governs how the domain randomization engine iterates over configured parameters and applies them to Isaac Gym actors and simulation state via the physics API.
Description
Randomization state initialization sets up per-environment physics variations by modifying Isaac Gym actor and simulation properties: masses, friction coefficients, joint damping, stiffness, armature, joint limits, restitution, actor scale, gravity, and more. The system operates at two levels:
Non-environment parameters (simulation-level) are randomized globally:
- Gravity randomization adds gaussian noise to gravity vector components.
- Observation noise constructs noise lambda functions that are applied to observation tensors each step.
- Action noise constructs noise lambda functions applied to action tensors.
Per-environment parameters (actor-level) are randomized individually per environment on resets:
- DOF properties: damping, stiffness, effort, friction, armature, joint limits.
- Rigid body properties: mass.
- Rigid shape properties: friction and restitution (with PhysX material bucketing).
- Actor scale: global scale factor for the actor.
- Color: randomized visual appearance.
The base VecTask provides apply_randomizations() which orchestrates the process:
- Determine which environments need re-randomization (based on frequency, reset buffer, and first-randomization flag).
- Cache original property values on first call.
- For each actor and property, sample from the configured distribution and apply via the Isaac Gym property setter API.
- For observation and action noise, construct noise lambda closures that are applied during
step().
ADRVecTask extends this with per-environment DR parameter dictionaries (boundary workers get boundary values rather than sampled values), ADR tensor sampling, and callback hooks for gravity randomization.
Usage
Called automatically during training when task.randomize: True. The method is invoked from pre_physics_step() in task implementations:
- Manual DR:
self.apply_randomizations(dr_params=self.randomization_params) - ADR:
self.apply_randomizations(dr_params=self.randomization_params, randomize_buf=env_mask, adr_objective=self.successes, randomisation_callback=self.randomisation_callback)
Theoretical Basis
The randomization initialization follows a property injection pattern:
For each configured parameter P:
1. Sample value S from distribution D(range, type)
2. Apply operation:
- additive: new_P = original_P + S
- scaling: new_P = original_P * S
3. If bucketed: quantize new_P to nearest bucket
4. Set via physics API: gym.set_actor_<property>(env, handle, new_P)
Critical implementation details:
- Original property caching: On first randomization, original property values are stored in
self.original_props. All subsequent randomizations operate relative to these originals, preventing drift. - PhysX material bucketing: PhysX limits unique materials to approximately 64K. The
check_buckets()function validates that explicit bucketing keeps the count under this limit. Whennum_bucketsis specified, continuous samples are quantized to the nearest bucket value. - Noise lambdas: For observations and actions, rather than directly modifying buffers, the system constructs closure functions (
noise_lambda) that are applied at each step. These lambdas capture both correlated noise (refreshed atfrequencyintervals) and white noise (re-sampled every step). - ADR per-environment dictionaries: In ADR mode, boundary worker environments receive a patched DR dictionary where the randomization range for the evaluated parameter is collapsed to a single boundary value, while rollout workers use the current ADR ranges.