Event Terms¶
Event terms change the simulation outside the policy's control: they reset state, place objects and randomize
dynamics. Each runs in one mode from EventMode (STARTUP, RESET or INTERVAL, see constants).
The events guide explains modes, ordering and what each randomizer needs from the scene;
the term catalog lists every parameter.
The base classes EventTerm and EventTermFuncWrapper are on the managers page.
Resets¶
Reset event terms for base-state and DOF initialization.
Attributes¶
Classes¶
Functions:¶
reset_base_state_uniform
¶
reset_base_state_uniform(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, pos_x_range: Vec2FType = (-0.5, 0.5), pos_y_range: Vec2FType = (-0.5, 0.5), pos_z_range: Vec2FType = (0.0, 0.0), roll_range: Vec2FType = (0.0, 0.0), pitch_range: Vec2FType = (0.0, 0.0), yaw_range: Vec2FType = (-3.14, 3.14))
Reset the base to its default pose, offset and rotated at random.
The offsets are added to the entity's default root position, and the sampled roll / pitch / yaw (world
x-y-z, R_rpy = Rz @ Ry @ Rx) rotate the default orientation — R_rpy @ R_default — so an object
authored lying on its side stays on its side. Both writes use the authored frame (relative=True),
the frame default_root_pos is specified in: the asset's declared root origin lands on the target,
not the centre of mass Genesis re-origins a free body onto. A heterogeneous entity's per-variant default
poses are honored (Entity.get_default_root_pose). Similar to mjlab's reset_root_state_uniform,
which composes its rotation in the body frame instead (R_default @ R_rpy); the two agree for an
identity default orientation or a pure yaw about an upright default.
Rigid-only: relies on set_pos/set_quat, which raise on
:class:ParticleEntity (MPM/SPH). For deformable entities, bake pose into
the morph at creation time.
Source code in eden/managers/terms/events/resets.py
reset_dofs_by_offset
¶
reset_dofs_by_offset(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, dofs_pos_range: Vec2FType = (-0.1, 0.1), dofs_vel_range: Vec2FType | None = None)
Reset DOFs to default + U(offset), clamped to soft limits.
The offset is drawn per env and DOF. Velocities are zeroed (the base's too), then set to
U(dofs_vel_range) when that is given.
Rigid-only: requires a :class:RigidEntity (DOFs are not defined on
:class:ParticleEntity).
Source code in eden/managers/terms/events/resets.py
reset_dofs_by_scale
¶
reset_dofs_by_scale(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, dofs_pos_scale_range: Vec2FType = (0.95, 1.05))
Reset DOFs to default * U(scale) per env/DOF; velocities to 0.
Multiplicative variant of :func:reset_dofs_by_offset (legged_gym-style init used by
e.g. extreme-parkour). Rigid-only: requires a :class:RigidEntity.
Source code in eden/managers/terms/events/resets.py
reset_dofs_by_scale_and_offset
¶
reset_dofs_by_scale_and_offset(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, dofs_scale_range: Vec2FType = (0.8, 1.2), dofs_offset_range: Vec2FType = (-0.1, 0.1))
Reset DOFs to default * U(scale) + U(offset); velocities to 0.
Sampled per env and DOF, then clamped to the soft limits. OpenHomie's _reset_dofs:
:func:reset_dofs_by_scale and :func:reset_dofs_by_offset composed.
Rigid-only: requires a :class:RigidEntity.
Source code in eden/managers/terms/events/resets.py
Domain randomization¶
Pushes, external wrenches, DOF position and offset randomization, actuator randomization (motor strength, gains, backlash, deadband, torque noise) and mass, CoM and friction randomization.
Domain-randomization event terms (pushes, external wrenches, DOF randomization).
Attributes¶
Classes¶
PushByVelocity
¶
PushByVelocity(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Periodically add a random velocity to a free base.
velocity_range maps x / y / z (world-frame linear, m/s) and roll / pitch / yaw
(base-frame angular, rad/s) to (low, high); an axis left out is not perturbed.
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
interval_range_s
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
PushSetPlanarVelocity
¶
PushSetPlanarVelocity(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Periodically SET the base planar velocity to a random value.
Unlike :class:PushByVelocity (which ADDS a perturbation), this overwrites vx/vy
with U(velocity_xy_range) while keeping vz and the angular velocity unchanged —
the legged_gym/extreme-parkour push semantics. Uses the same free-joint DOF-write
convention: linear DOFs are world-frame, rotational DOF velocity is body-frame.
Source code in eden/managers/base.py
Attributes¶
interval_range_s
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
ApplyExternalForce
¶
ApplyExternalForce(env: EnvBase, options: EventTermOptions)
Bases: _ApplyExternalWrenchBase
Apply a randomized external force on specified links.
force_x_range / force_y_range / force_z_range are the per-axis force ranges (N), sampled uniformly
per env and link. See :class:_ApplyExternalWrenchBase for the shared parameters and the cross-term
independence caveat.
Source code in eden/managers/terms/events/domain_rand.py
ApplyExternalTorque
¶
ApplyExternalTorque(env: EnvBase, options: EventTermOptions)
Bases: _ApplyExternalWrenchBase
Apply a randomized external torque on specified links.
torque_x_range / torque_y_range / torque_z_range are the per-axis torque ranges (N·m), sampled
uniformly per env and link. See :class:_ApplyExternalWrenchBase for the shared parameters and the cross-term
independence caveat.
Source code in eden/managers/terms/events/domain_rand.py
SetRandomDofsPos
¶
SetRandomDofsPos(env: EnvBase, options: _TermOptionsT)
Bases: _RandomizeDofsPosBase
Set the joint positions of an entity's DOFs to a random position (default mode: reset).
Defaults to ratio mode, sampling within the first 20% of each DOF's limit range. See
:class:_RandomizeDofsPosBase for the full parameter description.
Source code in eden/managers/base.py
RandomizeDofsPosOffset
¶
RandomizeDofsPosOffset(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Per-env joint-position offset on joint position controllers (encoder bias).
Each selected controller draws its own offsets, one per env and controlled DOF, and takes them
through :meth:~eden.managers.terms.actions.joint_actions._JointPDControllerBase.set_dofs_pos_offset.
The draw adds to the controller's position target on top of its configured offset and its
reference_source reference, and replaces neither, so it composes with a static offset and,
in either order, with :class:RandomizeStartupDofsPosBias.
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
The joint position controller(s) to randomize: one term name, a list of
them, or
|
dofs_pos_range
|
Per-DOF offset range (radians) sampled uniformly per env and DOF.
|
Source code in eden/managers/base.py
Attributes¶
action_term_name
class-attribute
instance-attribute
¶
Methods:¶
build
¶
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeStartupDofsPos
¶
RandomizeStartupDofsPos(env: EnvBase, options: _TermOptionsT)
Bases: _RandomizeDofsPosBase
Randomize the absolute joint positions of an entity's DOFs (default mode: reset).
Writes joint positions directly via set_dofs_pos — useful for spawning each episode with a randomized
initial pose. Despite the name, defaults to mode=_RESET so it fires on every episode reset; override to
_STARTUP for a one-time draw. Defaults to absolute mode with a small ±1° range. See
:class:_RandomizeDofsPosBase for the full parameter description.
Source code in eden/managers/base.py
RandomizeStartupDofsPosBias
¶
RandomizeStartupDofsPosBias(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Bake a per-env joint-zero bias into entity.default_dofs_pos at startup.
Simulates motor calibration drift: each env gets a small fixed offset on every DOF of the entity, sampled once at
startup and held constant for the lifetime of the env. The bias persists across resets, unlike the per-reset
jitter from :class:RandomizeDofsPosOffset. The two compose: a calibration drift baked in at startup + small
per-episode jitter on top.
When action_terms_name lists one or more PD controllers, each controller's _offset cache (folded once at
build time as default_offset + configured_offset, see _JointPDControllerBase._build_scale_and_offset) is
updated in lockstep by adding the same per-env bias delta on the DOFs that controller owns. This avoids the
"stale cache" trap where mutating entity.default_dofs_pos would diverge from a controller's pre-folded static
offset.
Build-time contract. build() performs strict validation so that any stale-cache footgun surfaces loudly at
startup rather than as silent drift at runtime:
action_terms_namemust contain no duplicates.- Each listed term must be a :class:
_JointPDControllerBaseinstance, target the same entity, and havereference_source == ReferenceSource.DEFAULT. -
Every same-entity action term that caches
default_dofs_posat build must be either listed (and updated in lockstep) or rejected with a clear error. Specifically: -
_JointPDControllerBasewithreference_source=DEFAULTnot in the listed set: error (its_offsetwould silently go stale). - :class:
NullJointActioncaches a copy ofdefault_dofs_posat build with no refresh path; if it is present on the same entity,build()errors out.OperationalSpaceControllerrefreshes its declared nullspace reference at reset and therefore does not need this rejection.
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The entity to bias.
|
action_terms_name
|
Names of PD controller action terms whose
|
dofs_pos_range
|
Per-DOF bias range, sampled uniformly. Default ±1 degree.
|
Source code in eden/managers/base.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeMotorStrength
¶
Bases: _ResetModeActuatorDR
Randomize a :class:MotorStrength action modifier's scalar (default factor 0.9 to 1.1).
Requires
The action term must have a MotorStrength modifier (either directly or inside a Compose chain).
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
The name of the PD controller action term hosting the
|
motor_strength_range
|
Multiplicative range applied to the modifier's strength, sampled uniformly per env (one scalar per env).
|
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
motor_strength_range
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
RandomizeGearBacklash
¶
Bases: _ResetModeActuatorDR
Randomize the one-sided target offset of a :class:GearBacklash action modifier.
Requires
The action term must have a GearBacklash modifier (either directly or inside a Compose chain).
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
The name of the PD controller action term hosting the
|
backlash_range
|
When
|
apply_as_ratio
|
If false (default),
|
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
RandomizeConstantTorqueKick
¶
Bases: _ResetModeActuatorDR
Randomize the torque magnitude of a :class:ConstantTorqueKick action modifier.
Requires
The action term must have a ConstantTorqueKick modifier (either directly or inside a Compose chain).
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
The name of the PD controller action term hosting the
|
torque_kick_range
|
When
|
apply_as_ratio
|
If false (default),
|
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
RandomizeKpKdGains
¶
RandomizeKpKdGains(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Scale an entity's joint PD gains by a random factor.
With action_term_name set, the draw goes into that controller's own gain caches, over the controller's DOFs
in its dofs_name order: each cache becomes the entity's current gains times the drawn factor. Writing them
only in :meth:compute is not enough: the controller's reset() re-reads its caches from the entity, and in
both reset and startup mode that re-read lands after the draw (the ordering :class:_ResetModeActuatorDR
describes), leaving the randomization silently inert. So the term keeps each env's factors and applies them
again in :meth:reset, which runs after action_manager.reset(); a draw in any mode then holds until that
env's next draw. Keeping factors rather than gains is what lets it compose with anything else that changes the
entity's gains (an entity-path RandomizeKpKdGains, a gain curriculum): each reset scales whatever the entity
holds then, and an env not yet drawn keeps the entity's gains unchanged (factor 1).
Requires
env_options.batch_dofs_info=True to support per-env PD gain randomization.
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
If set, the name of an
|
kp_range
|
Multiplicative range, sampled uniformly per env and DOF. On the entity path it multiplies
|
kd_range
|
As
|
Source code in eden/managers/base.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
reset
¶
reset(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeDeadbandEpsilon
¶
Bases: _ResetModeActuatorDR
Randomize the position-error threshold of a :class:Deadband action modifier.
Requires
The action term must have a Deadband modifier (either directly or inside a Compose chain).
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to control.
|
action_term_name
|
The name of the PD controller action term hosting the
|
deadband_epsilon_range
|
When
|
apply_as_ratio
|
If false (default),
|
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
deadband_epsilon_range
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
RandomizeFrictionRatio
¶
RandomizeFrictionRatio(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Randomize sliding friction on links_name to absolute values, not a scale.
Every compute() first pins the whole entity's base friction to 1.0 (set_friction(1.0),
entity-wide — this discards any authored default_geoms_friction, including on links outside
links_name, which are left at a flat 1.0) and then writes per-link ratios on links_name.
friction_range is therefore an absolute coefficient range, regardless of what the asset
authored; a source config expressed as "scale x authored value" must be converted to the
resulting absolute range. Genesis multiplies the same ratio into the torsional and rolling
coefficients where those axes are enabled, so this term randomizes spin resistance too.
Genesis resolves a contact pair's friction as max(a, b), so the randomized coefficient only
takes effect against surfaces whose friction is below the sampled value — author the ground
plane low (e.g. PlaneOptions(default_geoms_friction={"*": 0.01})) so the robot side always
wins. Overlapping link sets (a whole-robot pass plus a tighter feet range) are ordered by the
events' priority field (ascending). mode defaults to reset, but friction DR is usually a
per-env-lifetime property — every in-tree task uses mode="startup". The full porting recipe
lives in docs/guides/entities.md ("Porting a friction-randomization setup").
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeComShift
¶
RandomizeComShift(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Offset the named links' centres of mass, per env.
Samples a per-env, per-link xyz offset (meters, link frame) from the three axis ranges and
writes nominal_COM + shift. Requires EnvOptions(batch_links_info=True) — Genesis stores
link inertial info once for the whole batch otherwise, and rejects the per-env write. Rejects
a link fixed to the world at build, whose COM the solver never reads.
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeMassShift
¶
RandomizeMassShift(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Add a per-env offset to the named links' masses.
Samples a per-env, per-link shift (kg) from mass_shift_range and writes
nominal_mass + shift. Requires EnvOptions(batch_links_info=True), and rejects a
range whose lower bound could drive a selected link's mass non-positive — the write
itself is unchecked (Genesis skips the device-side check for speed), so it would
otherwise silently produce unphysical dynamics. It also rejects a link fixed to the world,
whose mass the solver never reads.
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeLinkMassScale
¶
RandomizeLinkMassScale(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Multiplicative per-link mass randomization.
Scales each specified link's mass by a random factor sampled from [mass_scale_range[0], mass_scale_range[1]].
Internally uses set_mass_shift with shift = mass * (scale - 1). Requires
EnvOptions(batch_links_info=True), and rejects a non-positive lower scale bound — the
write itself is unchecked, so a scale of zero or below would silently produce a massless
or negative-mass link.
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The entity to randomize.
|
links_name
|
Link name patterns to randomize.
|
mass_scale_range
|
Multiplicative scale range, e.g.
|
Source code in eden/managers/terms/events/domain_rand.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
RandomizeTorqueNoise
¶
RandomizeTorqueNoise(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Residual Force Injection (RFI) — adds random torque noise to actuated joints.
At each interval fire, samples [-rfi_scale, rfi_scale] per DOF and writes it into the TorqueOffset
modifier's _torque_offset buffer, which the action term reads when applying control torques. Simulates
actuator noise and unmodeled dynamics.
Must be used with mode = "interval" and an interval_range_s matching the control timestep; the event
manager rejects an interval term left at interval_range_s=None.
Requires
The action term must have a TorqueOffset modifier in its chain.
| PARAMETER | DESCRIPTION |
|---|---|
action_term_name
|
Name of the action term whose
|
rfi_scale
|
Maximum magnitude of the random torque noise (N·m).
|
Source code in eden/managers/base.py
Attributes¶
interval_range_s
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
ERFI50
¶
ERFI50(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
ERFI-50 noise: 50% Random Actuation Offset (RAO) + 50% Random Force Injection (RFI).
For each environment, a random value r in [0, 1] is drawn at reset:
- r < erfi_ratio (RAO): a fixed scalar offset
r * 3 * upper_boundis broadcast to all DOFs and held constant for the entire episode. - r >= erfi_ratio (RFI): independent per-DOF torque noise drawn uniformly from
[lower_bound, upper_bound].
Requires
The action term must have a TorqueOffset modifier.
| PARAMETER | DESCRIPTION |
|---|---|
interval_range_s
|
The interval range in seconds. Expected to be set to the control timestep.
|
action_term_name
|
The name of the action term to apply the noise to.
|
lower_bound
|
The lower bound of the torque noise (N·m).
|
upper_bound
|
The upper bound of the torque noise (N·m).
|
erfi_ratio
|
The fraction of envs that use RAO instead of RFI.
|
Reference
- Learning and Deploying Robust Locomotion Policies with Minimal Dynamics Randomization (https://arxiv.org/pdf/2209.12878)
Source code in eden/managers/base.py
Attributes¶
interval_range_s
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/domain_rand.py
reset
¶
reset(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/domain_rand.py
Functions:¶
Placement¶
Place objects on a support entity's surfaces, with constant, range, uniform or Gaussian samplers, or from a fixed
list of layouts that place several entities together without overlap (PlaceFromLayouts).
Object-placement event terms and support-surface samplers.
Attributes¶
Classes¶
Gaussian2D
¶
Source code in eden/managers/terms/events/placement.py
Attributes¶
Methods:¶
get_probs
¶
Compute the Gaussian weights for the given points.
| PARAMETER | DESCRIPTION |
|---|---|
points
|
The points to compute the weights for, of shape (N, 2)
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The weights for the points, of shape (N,) |
Source code in eden/managers/terms/events/placement.py
PlaceGaussian
¶
PlaceGaussian(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Event term that places an entity on a support surface via Gaussian-weighted sampling.
| PARAMETER | DESCRIPTION |
|---|---|
entity_name
|
The name of the entity to place
|
support_entity_name
|
The name of the support entity
|
mu_x
|
The mean of the x-coordinate in world frame
|
mu_y
|
The mean of the y-coordinate in world frame
|
var_x
|
The variance of the x-coordinate (m^2)
|
var_y
|
The variance of the y-coordinate (m^2)
|
Source code in eden/managers/terms/events/placement.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/placement.py
compute
¶
compute(envs_idx: slice | Tensor | None)
Source code in eden/managers/terms/events/placement.py
PlaceFromLayouts
¶
PlaceFromLayouts(env: EnvBase, options: EventTermOptions)
Bases: EventTerm
Each reset env draws one of a fixed list of layouts and places every entity the layout names.
A layout maps entity names to (x, y, yaw_deg): the world-frame xy on the support surface (z comes
off the surface) and a yaw in degrees on top of the entity's default root orientation. Drawing all the
entities' poses as one layout is what keeps them apart: two entities placed by independent ranges over
the same area can start overlapping, and physics then throws them apart on the first step.
| PARAMETER | DESCRIPTION |
|---|---|
layouts
|
The layouts, each naming the same entities. An env's layout is drawn uniformly at every reset.
|
support_entity_name
|
The entity whose surface the entities stand on.
|
Source code in eden/managers/terms/events/placement.py
Attributes¶
layouts
class-attribute
instance-attribute
¶
Methods:¶
build
¶
compute
¶
compute(envs_idx: slice | Tensor | None)
Source code in eden/managers/terms/events/placement.py
Functions:¶
constant_xy_sampler
¶
constant_xy_sampler(support_data: list[ExtendedSupportData], asset_AABB: Tensor, batch_size: int = 1, *, pos_xy: tuple[float, float], support_idx: int | None = None, frame: Literal['world', 'local'] = 'world', **kwargs)
Sample a constant xy placement position on the support surface.
| PARAMETER | DESCRIPTION |
|---|---|
support_data
|
the support data of the asset to place
TYPE:
|
asset_AABB
|
the AABB of the asset to place
TYPE:
|
batch_size
|
the number of placement positions to sample (one per environment).
TYPE:
|
pos_xy
|
the xy position of the object to place, interpreted in |
support_idx
|
which of the support entity's surfaces to place onto.
TYPE:
|
frame
|
coordinate frame for
TYPE:
|
**kwargs
|
additional keyword arguments, ignored by this sampler.
DEFAULT:
|
NOTE
|
|
NOTE
|
It is a user's responsibility to ensure the specified pos_xy is free from collision.
|
Source code in eden/managers/terms/events/placement.py
range_xy_sampler
¶
range_xy_sampler(support_data: list[ExtendedSupportData], asset_AABB: Tensor, batch_size: int = 1, *, range_x: tuple[float, float] | Tensor, range_y: tuple[float, float] | Tensor, support_idx: int | None = None, frame: Literal['world', 'local'] = 'world', **kwargs)
Sample an xy placement position uniformly from a rectangular range on the support surface.
| PARAMETER | DESCRIPTION |
|---|---|
support_data
|
the support data of the asset to place
TYPE:
|
asset_AABB
|
the AABB of the asset to place
TYPE:
|
batch_size
|
the number of placement positions to sample (one per environment).
TYPE:
|
range_x
|
the range of the x-coordinate of the object to place, interpreted in |
range_y
|
the range of the y-coordinate of the object to place, interpreted in |
support_idx
|
which of the support entity's surfaces to place onto.
TYPE:
|
frame
|
coordinate frame for the ranges.
TYPE:
|
**kwargs
|
additional keyword arguments, ignored by this sampler.
DEFAULT:
|
NOTE
|
|
NOTE
|
It is a user's responsibility to ensure the specified pos_xy is free from collision.
|
Source code in eden/managers/terms/events/placement.py
uniform_sampler
¶
uniform_sampler(support_data: list[ExtendedSupportData], asset_AABB: Tensor, holes: Tensor | None = None, **kwargs)
Sample a placement position uniformly from the pre-sampled support points.
| PARAMETER | DESCRIPTION |
|---|---|
support_data
|
the support data of the asset to place
TYPE:
|
asset_AABB
|
the AABB of the asset to place (B, 2, 3)
TYPE:
|
holes
|
the AABBs of existing objects concatenated in dim=1, e.g., (B, L, 2, 3) for L holes
TYPE:
|
**kwargs
|
additional keyword arguments, ignored by this sampler.
DEFAULT:
|
Source code in eden/managers/terms/events/placement.py
gaussian_sampler
¶
gaussian_sampler(support_data: list[ExtendedSupportData], asset_AABB: Tensor, holes: Tensor | None = None, gaussian_weights: Callable | None = None, **kwargs)
Sample a placement position from the support points weighted by a Gaussian.
| PARAMETER | DESCRIPTION |
|---|---|
support_data
|
the support data of the asset to place
TYPE:
|
asset_AABB
|
the AABB of the asset to place
TYPE:
|
holes
|
the AABBs of existing objects concatenated in dim=1, e.g., (B, L, 2, 3) for L holes
TYPE:
|
gaussian_weights
|
callable mapping candidate points to per-point sampling weights. If None, a default is used.
TYPE:
|
**kwargs
|
additional keyword arguments, ignored by this sampler.
DEFAULT:
|
Source code in eden/managers/terms/events/placement.py
place_constant_xy
¶
place_constant_xy(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, support_entity_name: str, pos_xy: tuple[float, float], frame: Literal['world', 'local'] = 'world', support_idx: int | None = None)
Source code in eden/managers/terms/events/placement.py
place_range_xy
¶
place_range_xy(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, support_entity_name: str, range_x: tuple[float, float], range_y: tuple[float, float], range_roll: tuple[float, float] = (0, 0), range_pitch: tuple[float, float] = (0, 0), range_yaw: tuple[float, float] = (0, 0), frame: Literal['world', 'local'] = 'world', support_idx: int | None = None)
Source code in eden/managers/terms/events/placement.py
place_uniform
¶
place_uniform(env: EnvBase, envs_idx: slice | Tensor | None, *, entity_name: str, support_entity_name: str, samples_per_area: int = 100)
Source code in eden/managers/terms/events/placement.py
Restoring saved states¶
RESET event restoring each resetting env to a row of a :class:~eden.utils.buffers.reset_states.ResetStateBuffer.
Attributes¶
Classes¶
ResetFromStateBuffer
¶
ResetFromStateBuffer(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Restore each resetting env to one stored row of a reset-state buffer file.
The buffer (:class:~eden.utils.buffers.reset_states.ResetStateBuffer, written by save()) names the
entities it covers. Each reset writes those entities' full state, meaning the root pose and velocity in the
authored frame and every joint by name, through one staged write; a fixed base built with
batch_fixed_verts=True (a robot mount or fixture placed per row) gets its root pose too. Entities it does
not name keep what the scene reset and the other RESET events leave. Which row each env gets is the sampler's
call: uniform by default, or the curriculum term named by sampler (e.g. Success Guided Sampling), bound to
this buffer's size at build.
RESET events run in ascending priority number, so give it a larger priority number than any RESET event
that writes the same entities; one that runs after it overwrites the restored state. Task data stored with the
rows (a goal) is read with :meth:current_column.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
The buffer file (
|
sampler
|
Config key of a curriculum term subclassing
|
category_weights
|
Draw a row's category by these weights (keyed by
|
Source code in eden/managers/base.py
Attributes¶
category_weights
class-attribute
instance-attribute
¶
current_config
property
¶
(num_envs,) row index each env was last reset to. Read it; don't write it.
Methods:¶
build
¶
Source code in eden/managers/terms/events/state_buffer.py
compute
¶
compute(envs_idx: slice | Tensor | None = None) -> None
Source code in eden/managers/terms/events/state_buffer.py
current_column
¶
current_column(name: str) -> Tensor
Task column name at each env's current row, (num_envs, ...); a goal stored with the states.
Source code in eden/managers/terms/events/state_buffer.py
Functions:¶
Contact solver parameters¶
Constraint-solver parameter events (contact stiffness tuning).
Attributes¶
Classes¶
Functions:¶
set_contact_sol_params
¶
set_contact_sol_params(env: EnvBase, envs_idx: slice | Tensor | None, *, sol_params: tuple[float, ...], entity_links: dict[str, list[str] | None]) -> None
Set constraint-solver (solref/solimp) parameters on selected entity geoms.
A STARTUP event: applies sol_params — (timeconst, dampratio, dmin,
dmax, width, mid, power), see the MuJoCo "Solver parameters" docs — to the
collision geoms of the named entities, leaving every other geom (and all
joint/limit constraints) at defaults. entity_links maps entity name to
the link names whose geoms to modify (None = all of the entity's geoms).
Note genesis mixes a contact pair's parameters as the mean of its two geoms' values, so a stiffened geom mildly stiffens every pair it participates in (e.g. an object also contacts the table), not only the pair of interest.
envs_idx must be None: genesis stores geom sol_params unbatched, so a
per-env selection would be silently ignored (the write always applies to all
envs) — rejected loudly here to keep the term out of per-env randomization.
Source code in eden/managers/terms/events/solver.py
Motion-reference initialization¶
RESET events that start each episode from a state of the motion reference (reference state initialization).
Motion-reference-driven event terms (RESET-mode initial-state seeding).
Attributes¶
Classes¶
ReferenceStateInitializationBase
¶
ReferenceStateInitializationBase(env: EnvBase, options: _TermOptionsT)
Bases: EventTerm
Shared base for the motion-reference RSI (reference-state-initialization) events.
Two concrete flavours seed initial state from the motion reference at RESET:
:class:ReferenceStateInitialization (the robot — a floating or immobile base)
and :class:ObjectReferenceStateInitialization (a free rigid object). This base
exists so the motion-end resync path can find every flavour by isinstance
(not by matching one exact class name) and ask each to seed itself onto a resampled
reference via :meth:teleport — so the branch knowledge lives in the term, in one
place, instead of being re-derived in :class:~eden.managers.motion.resync.MotionEndResync.
A flavour does not write the simulator itself: it stages its entity's writes
(:meth:_stage_reset, :meth:_stage_teleport) into a shared
:class:~eden.entities.rigid.StagedStateWrite, and :meth:compute_batch /
:meth:teleport_batch apply every term's writes at once. The event manager fires
adjacent RSI terms through one :meth:compute_batch, so a reset seeding N entities
gathers the reference once and pays one Genesis write per kind and one forward-kinematics
pass, not N of each.
Source code in eden/managers/base.py
Attributes¶
max_depenetration_velocity
class-attribute
instance-attribute
¶
max_depenetration_velocity: float | None = None
Methods:¶
compute_batch
classmethod
¶
compute_batch(terms: Sequence[ReferenceStateInitializationBase], envs_idx: slice | Tensor | None) -> None
Seed every term's entity from the init reference state, in one write (see the class docstring).
The terms draw their perturbation noise in order, as they would one by one, and write disjoint state, so the result is what firing them one after another leaves.
Source code in eden/managers/terms/events/motion.py
teleport_batch
classmethod
¶
teleport_batch(terms: Sequence[ReferenceStateInitializationBase], wrap_idx: Tensor, refs: Mapping[str, MotionReferenceData]) -> None
:meth:teleport every term's entity onto refs[entity_name], in one write.
wrap_idx is int env ids, or a (num_envs,) bool mask: then every env's frame 0 is staged
and the mask picks which are written, which Genesis does on the device — no nonzero(), so a
mask that selects no env costs no GPU->CPU sync either (the motion-end resync calls this every step).
Source code in eden/managers/terms/events/motion.py
teleport
¶
Snap wrap_idx envs onto ref verbatim (no reset perturbation).
The motion-end-resync counterpart of :meth:compute, staged and written the same way,
but it reads the already-filled ref (this entity's MotionReferenceData) at
frame 0 instead of recomputing the init reference state, and adds no noise (a wrap is
mid-episode, so the entity snaps exactly onto the demo). wrap_idx is an int tensor
of the env ids that wrapped, or the (num_envs,) bool mask of them.
Source code in eden/managers/terms/events/motion.py
ReferenceStateInitialization
¶
ReferenceStateInitialization(env: EnvBase, options: _TermOptionsT)
Bases: ReferenceStateInitializationBase
On reset, initialise robot state from the motion reference (RSI).
Reads env.motion_manager.get_reset_reference_state(envs_idx)[entity_name]
and writes it onto the entity's qpos/qvel, with optional per-DoF and
base-pose perturbations. overall_noise_scale multiplies all configured
perturbation ranges (pose, velocity, dofs_position) so a curriculum can
anneal init noise from a single knob.
Source code in eden/managers/base.py
Attributes¶
velocity_range
class-attribute
instance-attribute
¶
dofs_position_range
class-attribute
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/events/motion.py
ObjectReferenceStateInitialization
¶
ObjectReferenceStateInitialization(env: EnvBase, options: _TermOptionsT)
Bases: ReferenceStateInitializationBase
On reset, set a free rigid object from the motion reference.
The object counterpart of :class:ReferenceStateInitialization for
manipulation mimic tasks: writes the reference base pose and base
velocities of a DOF-less free-floating entity (e.g. the manipulated
object of a hand-object clip). Optional uniform XY perturbation matches
ConTrack's object domain randomization.