Event Functors#
This page lists all available event functors that can be used with the Event Manager. Event functors are configured using EventCfg and can be triggered at different stages: startup, reset, or interval.
Physics Randomization#
Functor Name |
Description |
|---|---|
|
Randomize object masses within a specified range. Supports both absolute and relative mass randomization. |
|
Randomize the center of mass of rigid objects by applying position offsets. Only works with dynamic objects. |
Visual Randomization#
Functor Name |
Description |
|---|---|
|
Randomize textures, base colors, and material properties (metallic, roughness, IOR). Implemented as a Functor class. Supports both RigidObject and Articulation assets. |
|
Vary light position, color, and intensity within specified ranges. |
|
Randomize global emission light color and intensity. Applies the same emission light properties across all environments. |
|
Randomize camera poses for viewpoint diversity. Supports both attach mode (pos/euler perturbation) and look_at mode (eye/target/up perturbation). |
|
Vary focal length (fx, fy) and principal point (cx, cy) within specified ranges. |
|
Set a rigid object’s visual material deterministically (non-random). Useful for configs that want fixed colors/materials during reset. |
|
Set a rigid object group’s visual material deterministically (non-random). Useful for configs that want fixed colors/materials during reset. |
Spatial Randomization#
Functor Name |
Description |
|---|---|
|
Randomize object positions and orientations. Supports both relative and absolute pose randomization. |
|
Vary end-effector initial poses by solving inverse kinematics. The randomization is performed relative to the current end-effector pose. |
|
Randomize robot joint configurations. Supports both relative and absolute joint position randomization, and can target specific joints. |
|
Randomize a virtual target pose and store it in env state. Generates random target poses without requiring a physical object in the scene. |
|
Sample grid cells for object placement without replacement. Implemented as a Functor class. Divides a planar region into a regular 2D grid and samples cells to place objects at their centers. |
Geometry Randomization#
Functor Name |
Description |
|---|---|
|
Randomize a rigid object’s body scale factors (multiplicative). Supports uniform scaling across all axes or independent per-axis scaling. |
|
Randomize body scale factors for multiple rigid objects. Supports shared sampling (same scale for all objects) or independent sampling per object. |
Asset Management#
Functor Name |
Description |
|---|---|
|
Swap object models from a folder on reset for visual diversity. Currently supports RigidObject assets with mesh-based shapes. |
|
Set up additional object attributes dynamically. Supports both static values and callable functions. Useful for setting up affordance data and other custom attributes. |
|
Register entity attributes to a registration dict in the environment. Supports fetching attributes from both entity properties and prepare_extra_attr functor. |
|
Register entity poses to a registration dict. Supports computing relative poses between entities and transforming object-frame poses to arena frame. |
|
Batch register multiple entity attributes and poses using a registry list. Combines register_entity_attrs and register_entity_pose functionality. |
|
Drop objects from a rigid object group one by one from a specified height with position randomization. |
|
Set UIDs of objects that should be detached from automatic reset. Useful for objects that need custom reset handling. |
Usage Example#
from embodichain.lab.gym.envs.managers.cfg import EventCfg, SceneEntityCfg
# Example: Randomize object mass on reset
events = {
"randomize_mass": EventCfg(
func="randomize_rigid_object_mass",
mode="reset",
params={
"entity_cfg": SceneEntityCfg(uid="cube"),
"mass_range": (0.1, 2.0),
"relative": False,
},
),
}