Genesis World: Universal and Generative Physics Engine
repository·main·Indexed 12 days ago
https://github.com/genesis-embodied-ai/genesis-worldA scalable simulation platform for physical AI featuring a unified multi-physics engine (Rigid, FEM, MPM, Particle, uipc) and photo-realistic rendering (Nyx, Luisa, Pyrender). It provides a Pythonic interface for robotics environments, ML pipelines, and agentic simulation, scaling from local kernels to datacenter GPUs. Version 1.3.2 supports asset parsing for URDF, MJCF, OBJ, GLB, and USD.
What's inside Genesis World
- Genesis World is a simulation platform for physical AI development. It provides a Pythonic simulation interface that integrates a unified multi-physics engine, a photo-realistic renderer, and a cross-platform compiler. The platform is designed to scale from local laptop kernels to datacenter-grade GPUs, making it suitable for robotics environments, ML pipelines, data generation, and agentic simulation.
Overview of Universal Robots UR5e MJCF Description
mainThis package provides a simplified MJCF (MuJoCo XML) description of the Universal Robots UR5e. It is derived from the official ROS-industrial URDF description.
Requirements:
- MuJoCo 2.3.3 or later.
Explore Genesis World Demos by Layer
mainGenesis World provides runnable demos organized into three functional layers that mirror its core architecture:
- Physics: Demonstrates various solvers including Rigid body, FEM (Finite Element Method), MPM (Material Point Method), SPH (Smoothed Particle Hydrodynamics), PBD (Position Based Dynamics), and Stable Fluids. It also includes examples of multi-solver coupling (e.g., cloth on rigid bodies, rigid + MPM).
- Rendering: Provides camera sensor setups including built-in paths (Nyx, Luisa, Pyrender) and advanced walkthroughs via the
genesis-nyxrepository (covering PBR materials, light types, and 3D Gaussian splatting). - Simulation Interface: Covers practical robotics and simulation tasks such as robot control, GUI tools (ImGui), heterogeneous environments, domain randomization, and a wide array of sensors (Depth, IMU, Lidar, Tactile, Contact Force, etc.).
Franka Emika Panda MJCF Description
mainThis package provides a simplified MJCF (MuJoCo XML) description of the Franka Emika Panda robot. It is derived from the official Franka ROS URDF description and is optimized for use in MuJoCo simulations.
Requirements:
- MuJoCo 2.3.3 or later.
Available Franka Panda MuJoCo models
mainThe
franka_simasset directory contains MuJoCo XML models for the Franka Panda robot. There are two primary configurations available:- Single Franka Panda: Defined in
franka_panda.xml. - Dual Franka Panda (bi-franka): Defined in
bi-franka_panda.xml, providing a setup with two Franka robots.
| Model Name | XML File | | :--- | :--- | | Franka Panda | `franka_panda.xml` | | Bi-Franka Panda | `bi-franka_panda.xml` |- Single Franka Panda: Defined in
Understand the relationship between USD Prims and Genesis Links
mainWhen parsing USD, there is a mapping between a USD
Prim(denoted $i$) and a corresponding Genesislink(denoted $i'$).There is no direct relationship between the local transform of a USD parent-child pair ($T^i_j$) and the Genesis parent-child pair ($Q^{i'}_{j'}$). Instead, the relationship is defined in world space:
$$T^w_i = Q^w_{i'} imes S^{i'}_i$$
Where:
- $T^w_i$ is the world-space transform of the USD
Prim. - $Q^w_{i'}$ is the world-space transform of the Genesis
link. - $S^{i'}_i$ is the scale matrix that transforms from the Genesis link to the USD prim (this scale is baked into the meshes on
link$i'$).
- $T^w_i$ is the world-space transform of the USD
Avoid state change detection via snapshot comparison
mainNever attempt to detect changes in the simulation state by comparing two snapshots of data for equality (e.g.,
if current_state == previous_state:).This approach is prohibited because:
- It is computationally expensive (requires a gather and a compare).
- It fails under zero-copy conditions (where both snapshots alias the same memory and will always appear equal).
- It duplicates the source of truth.
Correct Approach: Use Genesis's dedicated change-detection facilities, such as solver StateChange subscriptions.
Use index variables and type tags in kernels
mainWhen writing kernels, use specific naming conventions for indices to avoid ambiguity:
- Loop and Held Indices: Use the format
i_<short code>, where the code is a 1-2 letter type tag (e.g.,i_bfor batch,i_dfor dof,i_lfor link,i_gfor geom). - Nested Indices: Use
j_for a second nested index of the same type (e.g.,i_dandj_dfor nested dof loops). - Relative (Offset) Indices: Append a trailing underscore to indicate an index that will be offset (e.g.,
i_c_). Usei_c_startandi_c_endfor absolute boundaries. - Persistent Tensors: The
_idxsuffix is reserved strictly for persistent tensors/fields (e.g.,contact_sort_idx). Never use_idxfor local loop counters. - Batch Functions: A
@qd.functhat processes a single environment (the first argumenti_b) called from a batch loop must be suffixed_batch(e.g.,func_solve_mass_batch).
Common Type Tags:
i_b: batch/environmenti_c: contacti_d: dofi_e: entityi_g/i_ga/i_gb: geom(s)i_l/i_la/i_lb: link(s)i_v: vertexi_f: facei_con: constrainti_p/i_q: current/previous item in a sort
- Loop and Held Indices: Use the format
Drone Technical Specifications and Controls
mainThe drone simulations in this directory use the following technical configuration:
- Model: Crazyflie 2.X (
urdf/drones/cf2x.urdf) - Base Hover RPM: Approximately 14468
- Control Method: Differential RPM control. Movement is achieved by varying individual rotor RPMs to create directional thrust (e.g., adjusting front/back rotor pairs for forward/backward movement).
- Safety Limits: RPM changes are automatically clipped to a safe range of
0-25000RPM. - Physics: Includes realistic gravity and aerodynamics.
- Model: Crazyflie 2.X (
Name containers and nested structures in Genesis
mainTo maintain consistency in data structures, follow these naming patterns:
- Single Attribute Containers: Name them
parent-type-firstwith the pluralson the first word only (e.g.,links_dof_start, notdof_start_links). Alternatively, use a suffix like_pair,_set,_map, or_list. - Nested Containers: Order words from highest to lowest in the hierarchy, applying plural markers at each level of nesting (e.g.,
geoms_vertices_idx). - Avoid Generic Prefixes: Do not use
all_for containers; name the content specifically (e.g.,joints_xanchor,links_inertia_i).
- Single Attribute Containers: Name them
Follow Genesis coding philosophy and priorities
mainWhen contributing to Genesis, adhere to these core principles:
- Reference Implementation: Use
genesis/engine/solvers/rigid/as the gold standard for naming, kernel structure, and organization. - Code Quality over Consistency: Always prioritize Genesis conventions over the style of original research code or prototypes you are porting.
- Performance Priorities:
- Initialization/Scene Construction: Prioritize maintainability and clarity over micro-optimization.
- Runtime Hot Paths: Prioritize efficiency. Minimize GPU-CPU transfers and use bulk, vectorized operations.
- No Legacy/Dead Code: Remove unused helpers, commented-out experiments, and proactive private helpers. Experimental subsystems should not carry deprecation burdens.
- Contribution Criteria: A contribution is only accepted if it provides measurable benefit in Speed (significant gain on
tests/benchmarks/), Robustness (new unit tests covering corner cases), or Ease of Use (removing tuning parameters rather than adding them).
- Reference Implementation: Use
How USD scaling is handled in Genesis
mainGenesis
linktransforms are rigid only (rotation and translation), meaning they do not support scaling. To maintain the visual appearance of USD assets that include scaling, the Genesis USD parser decomposes the USD transform $T$ (rotation $R$, scaling $S$, and translation $t$) into a rigid transform $Q$ and a scale matrix $S$ such that $T = Q imes S$.- The rigid component $Q$ is used for the Genesis
linktransform. - The scale component $S$ is baked into the mesh geometry (via
geom_ST) to preserve the intended size and appearance.
Handling Reflections (Negative Scale): If a USD asset uses negative scaling (e.g.,
(-1, -1, -1)) to create a reflection, the parser ensures the Genesislinktransform remains a proper rotation ($\det Q = +1$). The reflection is absorbed into the scale matrix $S$ by flipping the first column of $R$ and the first row of $S$.Consequences for Collision Shapes: Because $S$ can contain negative values, primitive collision dimensions (like sphere radius or box extents) are calculated using the absolute value of the scale diagonal:
np.abs(np.diag(S)). This ensures collision sizes remain positive while the baked mesh maintains the correct handedness.- The rigid component $Q$ is used for the Genesis