Domain Randomization¶
This page only describes the current domain randomization status of registered tasks in the repo. All conclusions come from the code; nothing is inferred from design intent.
Manager-Based event terms are the only DR declaration path:
Manager-Based (Compatible) tasks: reset / interval randomization is declared through Hydra
events:manager terms in the owner YAML; reset-lifecycle events sample at reset, interval-lifecycle events perturb between steps. See theevents:block ofsrc/unilab/conf/ppo/task/go2_joystick_flat/base.yamlfor an example.
The Manager-Based lifecycle is:
construction path: fixed model/tool identity is attached to
SceneCfgbefore backend constructionreset path: event terms compose writes in
ResetStateTransaction; the transaction commits once through the backend-owned packed reset transaction (SimBackend.bind_packed_reset())interval path: event terms submit backend-owned interval plans through the public contract
These three paths correspond to three lifecycle classes:
construction-lifecycle identity: fixed model/tool variants and their immutable env assignment take effect only during backend construction/materialization.
reset-lifecycle DR: items that do not change model identity, only change parameters or reset state within the same model, e.g.
base_mass_delta,base_com_offset,gravity,kp,kd, and backend-declared geometry/model fields.interval-lifecycle DR: external perturbations between steps, e.g. push.
Status Conclusions¶
Reset/interval randomization consists of
events:manager terms in the owner YAML, executed uniformly by the manager lifecycle.Manager-Based owners declare reset behavior through Hydra command/event terms. G1 motion reset perturbations belong to the device-resident
MotionCommandCfg, while task owners addEventTermCfgreset and interval terms.TensorResetRandomizationPayload(the torch-first reset payload) expresses curated reset terms; a backend must advertise every requested term on the matching host/device plane and own its derived-quantity obligation.MotrixBackendcurrently supportsbase_mass_delta,base_com_offset,kp,kd, and interval push; and it requires all model actuators to be position actuators during initialization.Fixed mesh/tool identity is declared by
env.fixed_model_variants; reset-time geometry fields remain behind backend capability declarations and never change that identity.
Uniformity Assessment Table¶
Task |
Declaration path |
Structured form? |
reset form |
interval form |
Code |
|---|---|---|---|---|---|
|
Hydra |
Yes: owner YAML declares reset events |
root-state reset + |
none |
|
|
Hydra |
Yes: Hydra |
root-state reset + kp/kd via |
none |
|
|
Hydra command term |
Yes: Hydra device-resident |
motion frame, root pose/velocity, and joint-position sampling |
none |
|
Per-task Domain Randomization List¶
Task |
Currently implemented reset domain randomization |
Currently implemented interval domain randomization |
Default state |
|---|---|---|---|
|
base xy/yaw and base qvel via |
none |
event terms declared and enabled by default in |
|
base xy/yaw and base qvel via |
none |
kp/kd enabled on mujoco owners by default; disabled on motrix/mjwarp owners |
|
Motion-command frame sampling; root pose perturbation |
none |
|
Current DR Capabilities and Boundaries¶
The owner YAML declares event terms; ResetStateTransaction composes selected
rows and validates shapes; UniSim backends advertise and apply the curated
payload. Task-specific reset sampling remains owned by command/event terms:
G1MotionTrackingpose / velocity / joint noise is owned by its manager command.Fixed model/tool identity is construction-time and never reset-time DR.
A requested backend capability that is not advertised fails closed; there is no filtering or silent fallback.
Reset gravity Usage¶
gravity is a reset-lifecycle DR: on each reset, a full MuJoCo gravity vector
(gx, gy, gz) is sampled per selected environment and dispatched through
TensorResetRandomizationPayload.gravity. Configure it with a reset EventTermCfg
that calls randomize_physics_scene_gravity; unsupported backends fail closed.
A small tilt range is recommended because large horizontal gravity can make an
early task unlearnable.
Interval push Usage¶
Manager-Based tasks configure interval push through the env.events.push_robot
term using push_by_setting_velocity with an interval and per-axis velocity
ranges.
Fixed Model/Tool Variant Boundary¶
Manager-Based owners declare fixed variants on the environment config. The task owns names, source descriptors, and the final assignment; it does not compile a model:
env:
fixed_model_variants:
variants:
- name: tool_a
source_model_file: tools/tool_a.xml
- name: tool_b
source_model_file: tools/tool_b.xml
# Omit explicit_variant_names for deterministic round-robin assignment.
explicit_variant_names: [tool_a, tool_b]
The Manager factory turns the declaration into a read-only int32 assignment
with shape (num_envs,); an empty explicit list selects round-robin.
The assignment is task identity: it is fixed after backend construction and is
not resampled by reset events.
UniLab does not open, parse, or compile source_model_file, and does not hold
MjSpec, MjModel, mjbatch, or Warp objects. UniSim adapters own source
realization and must declare supports_fixed_variants. Until that
contract lands, a task configured with fixed variants fails closed before env
construction. Heterogeneous variants that cannot expose one public
state/action/sensor layout also fail closed.
Reset-time model-field DR stays inside the selected identity. Its canonical or
per-env baselines come from the backend’s declared
get_reset_term_default(term) contract; Manager terms do not recompile the
scene or apply a canonical baseline to every tool. When only part of a model
table is randomized, unwritten columns retain the selected environment’s
variant baseline.
The ownership boundary and MJWarp/CPU executor split are recorded in ADR-0010.