embodichain.lab.sim#
EmbodiChain’s simulation core.
Organized around the SimulationManager (the DexSim scene handle), the scene-object hierarchy, sensors, IK solvers, motion planners, the atomic-action layer, and shared configuration types.
Overview#
The sim package is EmbodiChain’s simulation core. It is organized around
the SimulationManager (the DexSim scene handle), the scene-object
hierarchy (lights, rigid/soft/cloth bodies, articulations, robots, gizmos,
constraints), the sensor suite (cameras, stereo cameras, contact sensors), the
motion package for solvers, planners, workspace, and trajectory augmentation,
the atomic-action motion-primitive layer, and the shared configuration types and
utilities that wire all of these together.
Submodules
Lightweight hierarchical profiler shared by simulation and environments. |
|
Scene-object classes spawned into the |
|
Robot-specific configuration presets ( |
|
Sensors attached to the simulation scene. |
|
Robot motion solving, planning, workspace analysis, and trajectory augmentation. |
|
|
Typed planning contracts and built-in atomic actions. |
Helper utilities for simulation state conversion, mesh/geometry handling, configuration transforms, keyboard interaction, and action/solver adaptation. |
Simulation Manager#
Profiler#
- class embodichain.lab.sim.Profiler[source]#
Bases:
objectHierarchical wall-time profiler.
- Parameters:
cfg (
Optional[ProfilerCfg]) – Profiler configuration.Nonedisables profiling entirely.device (
device) – Device used for optional CUDA synchronization and NVTX ranges.
Note
One profiler tracks one synchronous call stack. Use it on the simulation thread that owns the associated simulation manager.
Methods:
__init__(cfg, device)report()Log a profiling report table and optionally dump JSON.
section(name, *[, is_root])Record wall time for a named section.
Attributes:
Whether profiling is active.
- property enabled: bool#
Whether profiling is active.
- report()[source]#
Log a profiling report table and optionally dump JSON.
- Return type:
Dict[str,object]- Returns:
Report data, or an empty dictionary when profiling is disabled.
- section(name, *, is_root=False)[source]#
Record wall time for a named section.
- Parameters:
name (
str) – Leaf section name. The full name is derived from the active section stack.is_root (
bool) – Whether this section starts a top-level profiling sample. A nested root is transparent and its children remain attached to the active outer hierarchy.
- Return type:
Iterator[None]
- class embodichain.lab.sim.ProfilerCfg[source]#
Bases:
objectConfiguration for hierarchical wall-time profiling.
Attributes:
Color terminal report rows by logical module.
Enable per-section wall-time statistics (mean/min/max/std).
Push NVTX ranges for sections so they appear in Nsight Systems.
Optional JSON path written by
Profiler.report().Synchronize CUDA at section boundaries for accurate GPU wall time.
Number of top-level root sections to discard before recording.
-
color_output:
bool# Color terminal report rows by logical module.
This only affects the logged table; JSON report data remains unchanged.
-
enable_time:
bool# Enable per-section wall-time statistics (mean/min/max/std).
-
nvtx:
bool# Push NVTX ranges for sections so they appear in Nsight Systems.
-
output_path:
str|None# Optional JSON path written by
Profiler.report().
-
sync_cuda:
bool# Synchronize CUDA at section boundaries for accurate GPU wall time.
-
warmup_steps:
int# Number of top-level root sections to discard before recording.
-
color_output:
Configuration#
Classes:
Configuration for an articulation asset in the simulation. |
|
Configuration for a cloth body asset in the simulation. |
|
ClothPhysicalAttributesCfg(youngs: 'float' = <factory>, poissons: 'float' = <factory>, dynamic_friction: 'float' = <factory>, elasticity_damping: 'float' = <factory>, thickness: 'float' = <factory>, bending_stiffness: 'float' = <factory>, bending_damping: 'float' = <factory>, enable_kinematic: 'bool' = <factory>, enable_ccd: 'bool' = <factory>, enable_self_collision: 'bool' = <factory>, has_gravity: 'bool' = <factory>, self_collision_stress_tolerance: 'float' = <factory>, collision_mesh_simplification: 'bool' = <factory>, vertex_velocity_damping: 'float' = <factory>, mass: 'float' = <factory>, density: 'float' = <factory>, max_depenetration_velocity: 'float' = <factory>, max_velocity: 'float' = <factory>, self_collision_filter_distance: 'float' = <factory>, linear_damping: 'float' = <factory>, sleep_threshold: 'float' = <factory>, settling_threshold: 'float' = <factory>, settling_damping: 'float' = <factory>, min_position_iters: 'int' = <factory>, min_velocity_iters: 'int' = <factory>) |
|
DexSim DLSS configuration for window and offscreen rendering. |
|
A gpu memory configuration dataclass that neatly holds all parameters that configure physics GPU memory for simulation |
|
Properties to define the drive mechanism of a joint. |
|
Configuration for a light asset in the simulation. |
|
Per-link physics override matched by regex on articulation link names. |
|
Configuration for visual markers in the simulation. |
|
Base configuration for an asset in the simulation. |
|
PhysicsCfg(gravity: 'np.ndarray' = <factory>, bounce_threshold: 'float' = <factory>, enable_ccd: 'bool' = <factory>, length_tolerance: 'float' = <factory>, speed_tolerance: 'float' = <factory>) |
|
RenderCfg(renderer: "Literal['auto', 'hybrid', 'fast-rt', 'rt']" = <factory>, spp: 'int' = <factory>, dlss: 'DLSSCfg' = <factory>, tone_mapping_enabled: 'bool' = <factory>, tone_mapping_exposure: 'float' = <factory>) |
|
Physical attributes for rigid bodies. |
|
Partial rigid-body attribute overrides for per-link physics configuration. |
|
Configuration for a fixed constraint between two RigidObjects. |
|
Configuration for a rigid body asset in the simulation. |
|
Configuration for a rigid object group asset in the simulation. |
|
RobotCfg(uid: 'str | None' = <factory>, init_pos: 'tuple[float, float, float]' = <factory>, init_rot: 'tuple[float, float, float]' = <factory>, init_local_pose: 'np.ndarray | None' = <factory>, fpath: 'str' = <factory>, drive_pros: 'JointDrivePropertiesCfg' = <factory>, body_scale: 'tuple | list' = <factory>, attrs: 'RigidBodyAttributesCfg' = <factory>, link_attrs: 'dict[str, LinkPhysicsOverrideCfg] | None' = <factory>, fix_base: 'bool' = <factory>, disable_self_collision: 'bool' = <factory>, enable_gravity: 'bool' = <factory>, init_qpos: 'torch.Tensor | np.ndarray | Sequence[float]' = <factory>, qpos_limits: 'torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None' = <factory>, sleep_threshold: 'float' = <factory>, min_position_iters: 'int' = <factory>, min_velocity_iters: 'int' = <factory>, build_pk_chain: 'bool' = <factory>, compute_uv: 'bool' = <factory>, use_usd_properties: 'bool' = <factory>, control_parts: 'Dict[str, List[str]] | None' = <factory>, urdf_cfg: 'URDFCfg | None' = <factory>, solver_cfg: 'SolverCfg | Dict[str, SolverCfg] | None' = <factory>, workspace_cfg: 'Dict[str, RobotWorkspaceCfg] | None' = <factory>) |
|
Configuration for a soft body asset in the simulation. |
|
SoftbodyPhysicalAttributesCfg(youngs: 'float' = <factory>, poissons: 'float' = <factory>, dynamic_friction: 'float' = <factory>, elasticity_damping: 'float' = <factory>, material_model: 'SoftBodyMaterialModel' = <factory>, enable_kinematic: 'bool' = <factory>, enable_ccd: 'bool' = <factory>, enable_self_collision: 'bool' = <factory>, has_gravity: 'bool' = <factory>, self_collision_stress_tolerance: 'float' = <factory>, collision_mesh_simplification: 'bool' = <factory>, self_collision_filter_distance: 'float' = <factory>, vertex_velocity_damping: 'float' = <factory>, linear_damping: 'float' = <factory>, sleep_threshold: 'float' = <factory>, settling_threshold: 'float' = <factory>, settling_damping: 'float' = <factory>, mass: 'float' = <factory>, density: 'float' = <factory>, max_depenetration_velocity: 'float' = <factory>, max_velocity: 'float' = <factory>, min_position_iters: 'int' = <factory>, min_velocity_iters: 'int' = <factory>) |
|
SoftbodyVoxelAttributesCfg(triangle_remesh_resolution: 'int' = <factory>, triangle_simplify_target: 'int' = <factory>, maximal_edge_length: 'float' = <factory>, simulation_mesh_resolution: 'int' = <factory>, simulation_mesh_output_obj: 'bool' = <factory>) |
|
Standalone configuration class for URDF assembly. |
|
Configuration for printing the interactive viewer camera pose. |
|
Configuration for interactive viewer window recording. |
Functions:
|
Parse a |
- class embodichain.lab.sim.cfg.ArticulationCfg[source]#
Bases:
ObjectBaseCfgConfiguration for an articulation asset in the simulation.
This class extends the base asset configuration to include specific properties for articulations, such as joint drive properties, physical attributes.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Whether to use physical properties from USD file instead of config.
Methods:
from_dict(init_dict)Initialize the configuration from a dictionary.
-
attrs:
RigidBodyAttributesCfg# Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
-
body_scale:
tuple|list# Scale of the articulation in the simulation world frame.
-
build_pk_chain:
bool# Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
-
compute_uv:
bool# Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
-
disable_self_collision:
bool# Whether to enable or disable self-collisions.
-
drive_pros:
JointDrivePropertiesCfg# Properties to define the drive mechanism of a joint.
-
enable_gravity:
bool# Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
-
fix_base:
bool# Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
-
fpath:
str# Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_qpos:
Union[Tensor,ndarray,Sequence[float]]# Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
link_attrs:
dict[str,LinkPhysicsOverrideCfg] |None# Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
-
min_position_iters:
int# [1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
-
min_velocity_iters:
int# [0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
-
qpos_limits:
Union[Tensor,ndarray,Sequence[float],Dict[str,List[float]],None]# Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
-
sleep_threshold:
float# [0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
-
uid:
str|None#
-
use_usd_properties:
bool# Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
-
attrs:
- class embodichain.lab.sim.cfg.ClothObjectCfg[source]#
Bases:
ObjectBaseCfgConfiguration for a cloth body asset in the simulation.
This class extends the base asset configuration to include specific properties for cloth bodies, such as physical attributes and collision group.
Attributes:
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Euler angles (in degree) of the root in simulation world frame.
Physical attributes for the cloth body.
Mesh configuration for the cloth body.
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
physical_attr:
ClothPhysicalAttributesCfg# Physical attributes for the cloth body.
-
uid:
str|None#
-
init_local_pose:
- class embodichain.lab.sim.cfg.ClothPhysicalAttributesCfg[source]#
Bases:
objectClothPhysicalAttributesCfg(youngs: ‘float’ = <factory>, poissons: ‘float’ = <factory>, dynamic_friction: ‘float’ = <factory>, elasticity_damping: ‘float’ = <factory>, thickness: ‘float’ = <factory>, bending_stiffness: ‘float’ = <factory>, bending_damping: ‘float’ = <factory>, enable_kinematic: ‘bool’ = <factory>, enable_ccd: ‘bool’ = <factory>, enable_self_collision: ‘bool’ = <factory>, has_gravity: ‘bool’ = <factory>, self_collision_stress_tolerance: ‘float’ = <factory>, collision_mesh_simplification: ‘bool’ = <factory>, vertex_velocity_damping: ‘float’ = <factory>, mass: ‘float’ = <factory>, density: ‘float’ = <factory>, max_depenetration_velocity: ‘float’ = <factory>, max_velocity: ‘float’ = <factory>, self_collision_filter_distance: ‘float’ = <factory>, linear_damping: ‘float’ = <factory>, sleep_threshold: ‘float’ = <factory>, settling_threshold: ‘float’ = <factory>, settling_damping: ‘float’ = <factory>, min_position_iters: ‘int’ = <factory>, min_velocity_iters: ‘int’ = <factory>)
Methods:
attr()Convert to dexsim ClothBodyAttr.
Attributes:
Bending damping.
Bending stiffness.
Whether to simplify the collision mesh for self-collision.
Material density in kg/m^3.
Dynamic friction coefficient.
Elasticity damping factor.
Enable continuous collision detection (CCD).
If True, (partially) kinematic behavior is enabled.
Enable self-collision handling.
Whether the cloth is affected by gravity.
Global linear damping applied to the cloth.
Total mass of the cloth.
Maximum velocity used to resolve penetrations.
Clamp for linear (or vertex) velocity.
Minimum solver iterations for position correction.
Minimum solver iterations for velocity updates.
Poisson's ratio.
Distance threshold for filtering self-collision vertex pairs.
Stress tolerance threshold for self-collision constraints.
Additional damping applied during settling phase.
Threshold used to decide convergence/settling state.
Velocity/energy threshold below which the cloth can go to sleep.
Cloth thickness (m).
Per-vertex velocity damping.
Young's modulus (higher = stiffer).
-
bending_damping:
float# Bending damping.
-
bending_stiffness:
float# Bending stiffness.
-
collision_mesh_simplification:
bool# Whether to simplify the collision mesh for self-collision.
-
density:
float# Material density in kg/m^3.
-
dynamic_friction:
float# Dynamic friction coefficient.
-
elasticity_damping:
float# Elasticity damping factor.
-
enable_ccd:
bool# Enable continuous collision detection (CCD).
-
enable_kinematic:
bool# If True, (partially) kinematic behavior is enabled.
-
enable_self_collision:
bool# Enable self-collision handling.
-
has_gravity:
bool# Whether the cloth is affected by gravity.
-
linear_damping:
float# Global linear damping applied to the cloth.
-
mass:
float# Total mass of the cloth. If negative, density is used to compute mass.
-
max_depenetration_velocity:
float# Maximum velocity used to resolve penetrations.
-
max_velocity:
float# Clamp for linear (or vertex) velocity.
-
min_position_iters:
int# Minimum solver iterations for position correction.
-
min_velocity_iters:
int# Minimum solver iterations for velocity updates.
-
poissons:
float# Poisson’s ratio.
-
self_collision_filter_distance:
float# Distance threshold for filtering self-collision vertex pairs.
-
self_collision_stress_tolerance:
float# Stress tolerance threshold for self-collision constraints.
-
settling_damping:
float# Additional damping applied during settling phase.
-
settling_threshold:
float# Threshold used to decide convergence/settling state.
-
sleep_threshold:
float# Velocity/energy threshold below which the cloth can go to sleep.
-
thickness:
float# Cloth thickness (m).
-
vertex_velocity_damping:
float# Per-vertex velocity damping.
-
youngs:
float# Young’s modulus (higher = stiffer).
-
bending_damping:
- class embodichain.lab.sim.cfg.DLSSCfg[source]#
Bases:
objectDexSim DLSS configuration for window and offscreen rendering.
Ray Reconstruction (RR) and Super Resolution (SR) are independently configurable on the
"hybrid","fast-rt", and"rt"renderers. DLSS is enabled by default for both windows and offscreen cameras. Offscreen DLSS also requires the master switch to remain enabled.Attention
DLSS requires a Vulkan render device, a compatible NVIDIA GPU/driver, and a DexSim build with the NGX runtime. Initialization is deferred until rendering; configuration conversion alone cannot verify support. Each enabled offscreen camera needs its own temporal history and Vulkan exchange images, increasing GPU memory use.
Attributes:
Master switch for DLSS.
-1auto (58%),0Ultra Performance (~33%),1Performance (50%),2Balanced (58%),3Quality (~67%),4Ultra Quality (77%),5DLAA (100%).Positive, finite exposure multiplier used by the RR bridge.
Frame interval in milliseconds passed to DexSim's DLSS temporal path.
Enable DLSS for offscreen cameras, including in headless simulations.
Enable RR denoising.
Internal FastRT/OfflineRT window height; zero derives it from quality.
Internal FastRT/OfflineRT window width; zero derives it from quality.
DexSim compatibility field.
DexSim compatibility field.
Optional window target/render ratio, at least 1.0.
Enable SR upscaling.
Methods:
to_dexsim_cfg(window_width, window_height)Convert settings without changing the window or camera output size.
-
dlss_enabled:
bool# Master switch for DLSS. False retains the standard rendering path.
-
dlss_quality:
int# -1auto (58%),0Ultra Performance (~33%),1Performance (50%),2Balanced (58%),3Quality (~67%),4Ultra Quality (77%),5DLAA (100%).- Type:
Quality mode and derived internal scale
-
exposure_compensation:
float# Positive, finite exposure multiplier used by the RR bridge.
-
frame_time_delta_ms:
float# Frame interval in milliseconds passed to DexSim’s DLSS temporal path.
The default
0.0intentionally matchesdexsim.DLSSConfig: DexSim measures the actual render interval automatically. Set a positive value only for a fixed render cadence; this is a render-frame interval, not a physics or control timestep.
-
offscreen_dlss_enabled:
bool# Enable DLSS for offscreen cameras, including in headless simulations.
-
rayreconstruction_enabled:
bool# Enable RR denoising. Can be used without SR at the target resolution.
-
render_height:
int# Internal FastRT/OfflineRT window height; zero derives it from quality.
-
render_width:
int# Internal FastRT/OfflineRT window width; zero derives it from quality.
-
target_height:
int# DexSim compatibility field. Set the actual window or camera height instead.
-
target_width:
int# DexSim compatibility field. Set the actual window or camera width instead.
- to_dexsim_cfg(window_width, window_height)[source]#
Convert settings without changing the window or camera output size.
- Parameters:
window_width (
int) – Window width in pixels.window_height (
int) – Window height in pixels.
- Return type:
DLSSConfig- Returns:
Populated
dexsim.DLSSConfiginstance ready to assign toworld_config.dlss_config.- Raises:
ValueError – If the configuration contains invalid values.
-
upsample_ratio:
float|None# Optional window target/render ratio, at least 1.0. None leaves zero render dimensions for DexSim to derive from quality. When specified, computes each unset render dimension from the actual window size. Only FastRT/OfflineRT windows honor these overrides; hybrid and offscreen targets derive their internal resolution from quality.
-
upscale_enabled:
bool# Enable SR upscaling. Can be used independently of RR.
-
dlss_enabled:
- class embodichain.lab.sim.cfg.GPUMemoryCfg[source]#
Bases:
objectA gpu memory configuration dataclass that neatly holds all parameters that configure physics GPU memory for simulation
Attributes:
Increase this if you get 'Contact buffer overflow detected'
Increase this if you get 'Patch buffer overflow detected'
overflowing initial allocation size, increase capacity to at least %.'
-
found_lost_aggregate_pairs_capacity:
int#
-
found_lost_pairs_capacity:
int#
-
heap_capacity:
int#
-
max_rigid_contact_count:
int# Increase this if you get ‘Contact buffer overflow detected’
-
max_rigid_patch_count:
int# Increase this if you get ‘Patch buffer overflow detected’
-
temp_buffer_capacity:
int# overflowing initial allocation size, increase capacity to at least %.’
- Type:
Increase this if you get ‘PxgPinnedHostLinearMemoryAllocator
-
total_aggregate_pairs_capacity:
int#
-
found_lost_aggregate_pairs_capacity:
- class embodichain.lab.sim.cfg.JointDrivePropertiesCfg[source]#
Bases:
objectProperties to define the drive mechanism of a joint.
Attributes:
Joint armature added to joint-space spatial inertia.
Damping of the joint drive.
Joint drive type to apply.
Friction coefficient of the joint
Maximum effort that can be applied to the joint (in kg-m^2/s^2).
Maximum velocity that the joint can reach (in rad/s or m/s).
Stiffness of the joint drive.
Methods:
from_dict(init_dict, *[, defaults])Initialize the configuration from a dictionary.
-
armature:
Union[Dict[str,float],float]# Joint armature added to joint-space spatial inertia.
Units depend on the joint model:
For prismatic (linear) joints, the unit is mass [kg].
For revolute (angular) joints, the unit is mass * scene_length^2 [kg-m^2].
-
damping:
Union[Dict[str,float],float]# Damping of the joint drive.
The unit depends on the joint model:
For linear joints, the unit is kg-m/s (N-s/m).
For angular joints, the unit is kg-m^2/s/rad (N-m-s/rad).
-
drive_type:
Literal['force','acceleration','none']# Joint drive type to apply.
If the drive type is “force”, then the joint is driven by a force and the acceleration is computed based on the force applied. If the drive type is “acceleration”, then the joint is driven by an acceleration and the force is computed based on the acceleration applied. If the drive type is “none”, then no force will be applied to joint.
-
friction:
Union[Dict[str,float],float]# Friction coefficient of the joint
- classmethod from_dict(init_dict, *, defaults=None)[source]#
Initialize the configuration from a dictionary.
- Parameters:
init_dict (
Dict[str,Union[str,float,int,Dict[str,float]]]) – Joint-drive properties to override.defaults (
JointDrivePropertiesCfg|None) – Optional base properties whose unspecified values are preserved. If omitted, the class defaults are used.
- Return type:
- Returns:
Parsed joint-drive properties.
-
max_effort:
Union[Dict[str,float],float]# Maximum effort that can be applied to the joint (in kg-m^2/s^2).
-
max_velocity:
Union[Dict[str,float],float]# Maximum velocity that the joint can reach (in rad/s or m/s).
For linear joints, this is the maximum linear velocity with unit m/s. For angular joints, this is the maximum angular velocity with unit rad/s.
-
stiffness:
Union[Dict[str,float],float]# Stiffness of the joint drive.
The unit depends on the joint model:
For linear joints, the unit is kg-m/s^2 (N/m).
For angular joints, the unit is kg-m^2/s^2/rad (N-m/rad).
-
armature:
- class embodichain.lab.sim.cfg.LightCfg[source]#
Bases:
ObjectBaseCfgConfiguration for a light asset in the simulation.
Supports six light types matching the dexsim rendering backend:
"point": Per-environment omnidirectional point light with position and falloff radius. Created as a batched light (one per environment)."sun": Global directional sun light (infinite distance). Created as a single scene-level instance. Uses direction only; position is ignored. Sun-specific fields (angular_radius,halo_size,halo_falloff) are reserved for future backend support."direction": Global pure directional light at infinite distance. Created as a single scene-level instance. Direction only; no position."spot": Per-environment spotlight with position, direction, and inner/outer cone angles. Created as a batched light."rect": Per-environment rectangular area light with position, direction, width, and height. Created as a batched light."mesh": Per-environment mesh-based emissive light. Requires aMeshObjectviaembodichain.lab.sim.objects.light.Light.set_mesh()(not tensor-batched). Created as a batched light.
Attention
The
angular_radius,halo_size, andhalo_fallofffields are reserved for future use. The dexsim Python bindings do not yet expose setters for these sun-specific properties.Attributes:
Angular radius of the sun disc in degrees.
RGB color of the light source.
Direction vector for directional, spot, rect, and mesh lights.
Whether the light casts shadows.
Halo falloff for sun light.
Halo size for sun light.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Euler angles (in degree) of the root in simulation world frame.
Intensity of the light source in watts/m^2.
"point","sun","direction","spot","rect","mesh".Asset path for mesh-based emissive lights.
Falloff radius for point lights.
Height of the rectangular area light.
Width of the rectangular area light.
Inner cone angle of the spotlight in degrees.
Outer cone angle of the spotlight in degrees.
-
angular_radius:
float# Angular radius of the sun disc in degrees. Reserved for future use.
-
color:
tuple[float,float,float]# RGB color of the light source. Defaults to white
(1.0, 1.0, 1.0).
-
direction:
tuple[float,float,float]# Direction vector for directional, spot, rect, and mesh lights. Defaults to
(0.0, 0.0, -1.0)(pointing down along -Z).
-
enable_shadow:
bool# Whether the light casts shadows. Defaults to
True.
-
halo_falloff:
float# Halo falloff for sun light. Reserved for future use.
-
halo_size:
float# Halo size for sun light. Reserved for future use.
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
intensity:
float# Intensity of the light source in watts/m^2. Defaults to
30.0.
-
light_type:
Literal['point','sun','direction','spot','rect','mesh']# "point","sun","direction","spot","rect","mesh".- Type:
Light type. Supported
-
mesh_path:
str# Asset path for mesh-based emissive lights. Only used when
light_type="mesh". The actual mesh assignment is done viaembodichain.lab.sim.objects.light.Light.set_mesh()which accepts adexsim.models.MeshObject. This field stores the path for reference.
-
radius:
float# Falloff radius for point lights. Only used when
light_type="point". Defaults to10.0.
-
rect_height:
float# Height of the rectangular area light. Only used when
light_type="rect". Defaults to1.0.
-
rect_width:
float# Width of the rectangular area light. Only used when
light_type="rect". Defaults to1.0.
-
spot_angle_inner:
float# Inner cone angle of the spotlight in degrees. Only used when
light_type="spot". Defaults to30.0.
-
spot_angle_outer:
float# Outer cone angle of the spotlight in degrees. Only used when
light_type="spot". Defaults to45.0.
-
uid:
str|None#
- class embodichain.lab.sim.cfg.LinkPhysicsOverrideCfg[source]#
Bases:
objectPer-link physics override matched by regex on articulation link names.
Attributes:
Partial attribute overrides applied on top of
ArticulationCfg.attrs.Regex patterns matched against link names (full match).
Whether to recompute inertia when mass is overridden (DexSim flag).
Methods:
from_dict(init_dict)Initialize the configuration from a dictionary.
-
attrs:
RigidBodyAttributesOverrideCfg# Partial attribute overrides applied on top of
ArticulationCfg.attrs.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
link_names_expr:
list[str]# Regex patterns matched against link names (full match).
-
replace_inertial:
bool# Whether to recompute inertia when mass is overridden (DexSim flag).
-
attrs:
- class embodichain.lab.sim.cfg.MarkerCfg[source]#
Bases:
objectConfiguration for visual markers in the simulation.
This class defines properties for creating visual markers such as coordinate frames, lines, and points that can be used for debugging, visualization, or reference purposes in the simulation environment.
Attributes:
Index of the arena where the marker should be placed.
Type of arrow head for axis markers (e.g., CONE, ARROW, etc.).
Length of each axis arm in meters.
Thickness/size of the axis lines in meters.
List of 4x4 transformation matrices defining the position and orientation of each axis marker.
Type of corner/joint visualization for axis markers (e.g., SPHERE, CUBE, etc.).
RGBA color values for the marker lines.
Type of marker to display.
Name of the marker for identification purposes.
-
arena_index:
int# Index of the arena where the marker should be placed. -1 means all arenas.
-
arrow_type:
AxisArrowType# Type of arrow head for axis markers (e.g., CONE, ARROW, etc.).
-
axis_len:
float# Length of each axis arm in meters.
-
axis_size:
float# Thickness/size of the axis lines in meters.
-
axis_xpos:
Tensor|None# List of 4x4 transformation matrices defining the position and orientation of each axis marker.
-
corner_type:
AxisCornerType# Type of corner/joint visualization for axis markers (e.g., SPHERE, CUBE, etc.).
-
line_color:
List[float]# RGBA color values for the marker lines. Values should be between 0.0 and 1.0.
-
marker_type:
Literal['axis','line','point']# Type of marker to display. Can be ‘axis’ (3D coordinate frame), ‘line’, or ‘point’. (only axis supported now)
-
name:
str# Name of the marker for identification purposes.
-
arena_index:
- class embodichain.lab.sim.cfg.ObjectBaseCfg[source]#
Bases:
objectBase configuration for an asset in the simulation.
This class defines the basic properties of an asset, such as its type, initial state, and collision group. It is used as a base class for specific asset configurations.
Methods:
from_dict(init_dict)Initialize the configuration from a dictionary.
Attributes:
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Euler angles (in degree) of the root in simulation world frame.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
uid:
str|None#
- class embodichain.lab.sim.cfg.PhysicsCfg[source]#
Bases:
objectPhysicsCfg(gravity: ‘np.ndarray’ = <factory>, bounce_threshold: ‘float’ = <factory>, enable_ccd: ‘bool’ = <factory>, length_tolerance: ‘float’ = <factory>, speed_tolerance: ‘float’ = <factory>)
Attributes:
The speed threshold below which collisions will not produce bounce effects.
Enable continuous collision detection (CCD) for fast-moving objects.
Gravity vector for the simulation environment.
The length tolerance for the simulation.
The speed tolerance for the simulation.
Methods:
Convert to DexSim physics arguments.
-
bounce_threshold:
float# The speed threshold below which collisions will not produce bounce effects.
-
enable_ccd:
bool# Enable continuous collision detection (CCD) for fast-moving objects.
-
gravity:
ndarray# Gravity vector for the simulation environment.
-
length_tolerance:
float# The length tolerance for the simulation.
Note: the larger the tolerance, the faster the simulation will be.
-
speed_tolerance:
float# The speed tolerance for the simulation.
Note: the larger the tolerance, the faster the simulation will be.
- to_dexsim_args()[source]#
Convert to DexSim physics arguments.
Solver implementation details that are not exposed by
PhysicsCfgretain their established defaults here.- Return type:
Dict[str,Any]
-
bounce_threshold:
- class embodichain.lab.sim.cfg.RenderCfg[source]#
Bases:
objectRenderCfg(renderer: “Literal[‘auto’, ‘hybrid’, ‘fast-rt’, ‘rt’]” = <factory>, spp: ‘int’ = <factory>, dlss: ‘DLSSCfg’ = <factory>, tone_mapping_enabled: ‘bool’ = <factory>, tone_mapping_exposure: ‘float’ = <factory>)
Methods:
apply_to_dexsim_config(world_config)Apply rendering settings to a DexSim world configuration.
Convert the renderer name to DexSim's renderer enum.
Attributes:
DLSS settings for hybrid, fast-rt, and rt windows and offscreen cameras.
Renderer backend to use for the simulation.
Samples per pixel for ray tracing rendering.
Whether to map HDR RGB output with the modified Reinhard curve.
Fixed linear exposure multiplier applied before tone mapping.
- apply_to_dexsim_config(world_config)[source]#
Apply rendering settings to a DexSim world configuration.
- Parameters:
world_config (
WorldConfig) – DexSim world configuration to update in place.- Return type:
None
-
renderer:
Literal['auto','hybrid','fast-rt','rt']# Renderer backend to use for the simulation. Options are ‘auto’, ‘hybrid’, ‘fast-rt’, and ‘rt’.
Note: - ‘auto’ selects a default renderer based on the detected GPU: RTX-series cards use
‘hybrid’, while datacenter cards (A100/A800, H100/H800/H200/H20) use ‘fast-rt’. If no CUDA device is available or the GPU is unknown, it falls back to ‘hybrid’.
- ‘hybrid’ uses ray tracing for shadows and reflections while keeping rasterization for primary rendering,
providing a balance between performance and visual quality.
‘fast-rt’ is a fully ray-traced renderer for maximum visual fidelity, but may have higher computational cost.
‘rt’ is an offline ray-traced renderer for maximum visual fidelity, suitable for high-quality rendering tasks.
-
spp:
int# Samples per pixel for ray tracing rendering. This parameter is only valid when renderer is ‘hybrid’, ‘fast-rt’ or ‘rt’.
- to_dexsim_flags()[source]#
Convert the renderer name to DexSim’s renderer enum.
- Return type:
Renderer
-
tone_mapping_enabled:
bool# Whether to map HDR RGB output with the modified Reinhard curve.
-
tone_mapping_exposure:
float# Fixed linear exposure multiplier applied before tone mapping.
- class embodichain.lab.sim.cfg.RigidBodyAttributesCfg[source]#
Bases:
objectPhysical attributes for rigid bodies.
There are three parts of attributes that can be set: 1. The dynamic properties, such as mass, damping, etc. 2. The collision properties. 3. The physics material properties.
Attributes:
Angular damping coefficient.
Contact offset for collision detection.
Density of the rigid body in kg/m^3.
Dynamic friction coefficient.
Enable continuous collision detection (CCD).
Enable collision for the rigid body.
Linear damping coefficient.
Mass of the rigid body in kilograms.
Maximum angular velocity.
Maximum depenetration velocity.
Maximum linear velocity.
Minimum position iterations.
Minimum velocity iterations.
Rest offset for collision detection.
Restitution (bounciness) coefficient.
Threshold below which the body can go to sleep.
Static friction coefficient.
Methods:
attr()Convert to dexsim PhysicalAttr
from_dict(init_dict)Initialize the configuration from a dictionary.
-
angular_damping:
float# Angular damping coefficient.
-
contact_offset:
float# Contact offset for collision detection.
-
density:
float# Density of the rigid body in kg/m^3.
-
dynamic_friction:
float# Dynamic friction coefficient.
-
enable_ccd:
bool# Enable continuous collision detection (CCD).
-
enable_collision:
bool# Enable collision for the rigid body.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
linear_damping:
float# Linear damping coefficient.
-
mass:
float# Mass of the rigid body in kilograms.
Set to 0 will use density to calculate mass.
-
max_angular_velocity:
float# Maximum angular velocity.
-
max_depenetration_velocity:
float# Maximum depenetration velocity.
-
max_linear_velocity:
float# Maximum linear velocity.
-
min_position_iters:
int# Minimum position iterations.
-
min_velocity_iters:
int# Minimum velocity iterations.
-
rest_offset:
float# Rest offset for collision detection.
-
restitution:
float# Restitution (bounciness) coefficient.
-
sleep_threshold:
float# Threshold below which the body can go to sleep.
-
static_friction:
float# Static friction coefficient.
-
angular_damping:
- class embodichain.lab.sim.cfg.RigidBodyAttributesOverrideCfg[source]#
Bases:
objectPartial rigid-body attribute overrides for per-link physics configuration.
Fields set to
Noneare not applied and retain values from the baseRigidBodyAttributesCfg.Attributes:
Methods:
from_dict(init_dict)Initialize the configuration from a dictionary.
merge_with(base)Build a
PhysicalAttrfrom base values and overrides.-
angular_damping:
float|None#
-
contact_offset:
float|None#
-
density:
float|None#
-
dynamic_friction:
float|None#
-
enable_ccd:
bool|None#
-
enable_collision:
bool|None#
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
linear_damping:
float|None#
-
mass:
float|None#
-
max_angular_velocity:
float|None#
-
max_depenetration_velocity:
float|None#
-
max_linear_velocity:
float|None#
- merge_with(base)[source]#
Build a
PhysicalAttrfrom base values and overrides.- Return type:
PhysicalAttr
-
min_position_iters:
int|None#
-
min_velocity_iters:
int|None#
-
rest_offset:
float|None#
-
restitution:
float|None#
-
sleep_threshold:
float|None#
-
static_friction:
float|None#
-
angular_damping:
- class embodichain.lab.sim.cfg.RigidConstraintCfg[source]#
Bases:
objectConfiguration for a fixed constraint between two RigidObjects.
The constraint binds rigid_object_a’s entity[i] to rigid_object_b’s entity[i] within arena[i] (one constraint per arena).
- Parameters:
name (
str) – Base constraint name. Per-arena names are derived asf"{name}"(single env) orf"{name}_{i}"(multi env).rigid_object_a_uid (
str) – UID of the first RigidObject (must exist in the sim).rigid_object_b_uid (
str) – UID of the second RigidObject (must exist in the sim).local_frame_a (
ndarray|None) – 4x4 joint frame in object A’s local coordinates.None-> identity (object A’s origin). Accepts a single(4, 4)matrix (shared by all envs) or an(N, 4, 4)array (one frame per env). Defaults to None.local_frame_b (
ndarray|None) – 4x4 joint frame in object B’s local coordinates.None-> the frame is computed per env asinv(pose_B) @ pose_Afrom the objects’ current poses, so the constraint welds the objects at their current relative pose (rather than pulling their origins together). An explicit(4, 4)or(N, 4, 4)value is used verbatim. Defaults to None.constraint_type (
Literal['fixed']) – Reserved for future typed constraints (prismatic, revolute, spherical, d6). Only"fixed"is supported in v1.
Attention
Both objects must be
RigidObjectinstances and must share the same number of arenas.Attributes:
Constraint type.
Local joint frame on object A.
Local joint frame on object B.
Base name of the constraint (per-arena names are derived from this).
UID of the first RigidObject.
UID of the second RigidObject.
-
constraint_type:
Literal['fixed']# Constraint type. Only
"fixed"is supported in v1.
-
local_frame_a:
ndarray|None# Local joint frame on object A. None -> identity (object A’s origin).
-
local_frame_b:
ndarray|None# Local joint frame on object B. None ->
inv(pose_B) @ pose_Aper env (weld at the objects’ current relative pose).
-
name:
str# Base name of the constraint (per-arena names are derived from this).
-
rigid_object_a_uid:
str# UID of the first RigidObject.
-
rigid_object_b_uid:
str# UID of the second RigidObject.
- class embodichain.lab.sim.cfg.RigidObjectCfg[source]#
Bases:
ObjectBaseCfgConfiguration for a rigid body asset in the simulation.
This class extends the base asset configuration to include specific properties for rigid bodies, such as physical attributes and collision group.
Attributes:
The method used for approximate convex decomposition (ACD) of the mesh.
Scale of the rigid body in the simulation world frame.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Euler angles (in degree) of the root in simulation world frame.
The maximum number of convex hulls that will be created for the rigid body.
Resolution for the signed distance field (SDF) of the rigid body.
Shape configuration for the rigid body.
Whether to use physical properties from USD file instead of config.
Methods:
Convert the body type to dexsim ActorType.
-
acd_method:
str# The method used for approximate convex decomposition (ACD) of the mesh.
Deprecated since version Use:
MeshCfg.acd_methodinstead. This field is kept for backward compatibility and overrides the shape-level value when explicitly set."visacd","coacd", and"vhacd"are supported. Only used whenmax_convex_hull_numis set to larger than 1."visacd"requires CUDA support.
-
attrs:
RigidBodyAttributesCfg#
-
body_scale:
tuple|list# Scale of the rigid body in the simulation world frame.
-
body_type:
Literal['dynamic','kinematic','static']#
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
max_convex_hull_num:
int# The maximum number of convex hulls that will be created for the rigid body.
Deprecated since version Use:
MeshCfg.max_convex_hull_numinstead. This field is kept for backward compatibility and overrides the shape-level value when explicitly set.If set to larger than 1, the rigid body will be decomposed into multiple convex hulls using the approximate convex decomposition method specified by
acd_method.
-
sdf_resolution:
int# Resolution for the signed distance field (SDF) of the rigid body.
Deprecated since version Use:
MeshCfg.sdf_resolutioninstead. This field is kept for backward compatibility and overrides the shape-level value when explicitly set.The spacing of the uniformly sampled SDF is equal to the largest AABB extent of the mesh, divided by the resolution. If
sdf_resolutionis set to larger than 0, an SDF will be generated for collision detection. SDF will increase the accuracy of collision, but also takes more time to initialize and simulate.
-
uid:
str|None#
-
use_usd_properties:
bool# Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values. Only effective for USD files.
-
acd_method:
- class embodichain.lab.sim.cfg.RigidObjectGroupCfg[source]#
Bases:
objectConfiguration for a rigid object group asset in the simulation.
Rigid object groups can be initialized from multiple rigid object configurations specified in a folder. If folder_path is specified, user should provide a RigidObjectCfg in rigid_objects as a template configuration for all objects in the group.
For example: ```python rigid_object_group: RigidObjectGroupCfg(
folder_path=”path/to/folder”, max_num=5, rigid_objects={
- “template_obj”: RigidObjectCfg(
- shape=MeshCfg(
fpath=””, # fpath will be ignored when folder_path is specified
), body_type=”dynamic”,
)
}
)
Attributes:
Body type for all rigid objects in the group.
File extension for the rigid object assets.
Path to the folder containing the rigid object assets.
Maximum number of rigid objects to initialize from the folder.
Configuration for the rigid objects in the group.
Methods:
from_dict(init_dict)Initialize the configuration from a dictionary.
-
body_type:
Literal['dynamic','kinematic']# Body type for all rigid objects in the group.
-
ext:
str# File extension for the rigid object assets.
This is only used when folder_path is specified.
-
folder_path:
str|None# Path to the folder containing the rigid object assets.
This is used to initialize multiple rigid object configurations from a folder.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
-
max_num:
int# Maximum number of rigid objects to initialize from the folder.
This is only used when folder_path is specified.
-
rigid_objects:
Dict[str,RigidObjectCfg]# Configuration for the rigid objects in the group.
-
uid:
str|None#
- class embodichain.lab.sim.cfg.RobotCfg[source]#
Bases:
ArticulationCfgRobotCfg(uid: ‘str | None’ = <factory>, init_pos: ‘tuple[float, float, float]’ = <factory>, init_rot: ‘tuple[float, float, float]’ = <factory>, init_local_pose: ‘np.ndarray | None’ = <factory>, fpath: ‘str’ = <factory>, drive_pros: ‘JointDrivePropertiesCfg’ = <factory>, body_scale: ‘tuple | list’ = <factory>, attrs: ‘RigidBodyAttributesCfg’ = <factory>, link_attrs: ‘dict[str, LinkPhysicsOverrideCfg] | None’ = <factory>, fix_base: ‘bool’ = <factory>, disable_self_collision: ‘bool’ = <factory>, enable_gravity: ‘bool’ = <factory>, init_qpos: ‘torch.Tensor | np.ndarray | Sequence[float]’ = <factory>, qpos_limits: ‘torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None’ = <factory>, sleep_threshold: ‘float’ = <factory>, min_position_iters: ‘int’ = <factory>, min_velocity_iters: ‘int’ = <factory>, build_pk_chain: ‘bool’ = <factory>, compute_uv: ‘bool’ = <factory>, use_usd_properties: ‘bool’ = <factory>, control_parts: ‘Dict[str, List[str]] | None’ = <factory>, urdf_cfg: ‘URDFCfg | None’ = <factory>, solver_cfg: ‘SolverCfg | Dict[str, SolverCfg] | None’ = <factory>, workspace_cfg: ‘Dict[str, RobotWorkspaceCfg] | None’ = <factory>)
Classes:
Configuration for the kinematic solver used in the robot simulation.
Attributes:
Physical attributes for all links.
Scale of the articulation in the simulation world frame.
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
Whether to compute the UV mapping for the articulation link.
Control parts is the mapping from part name to joint names.
Whether to enable or disable self-collisions.
Properties to define the drive mechanism of a joint.
Whether gravity is enabled for the articulation.
Whether to fix the base of the articulation.
Path to the articulation asset file.
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Initial joint positions of the articulation.
Euler angles (in degree) of the root in simulation world frame.
Named per-link physics override groups keyed by regex on link names.
[1,255].
[0,255].
Override joint position limits of the articulation.
[0, max_float32]
Solver is used to compute forward and inverse kinematics for the robot.
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
Whether to use physical properties from USD file instead of config.
Runtime workspace cache configuration keyed by control-part name.
Methods:
build_pk_serial_chain([device])Build the serial chain from the URDF file.
from_dict(init_dict)Initialize the configuration from a dictionary.
save_to_file(filepath)Save config to a local file as JSON.
Return config as a JSON string.
- class SolverCfg#
Bases:
objectConfiguration for the kinematic solver used in the robot simulation.
Attributes:
The class type of the solver to be used.
The name of the end-effector link for the solver.
Weights for the inverse kinematics nearest calculation.
List of joint names for the solver.
The name of the root/base link for the solver.
The tool center point (TCP) position as a 4x4 homogeneous matrix.
The file path to the URDF model of the robot.
User defined Joint position limits [2, DOF] for the solver.
Methods:
from_dict(init_dict)Initialize the concrete solver configuration from a dictionary.
init_solver(device, **kwargs)-
class_type:
str# The class type of the solver to be used.
-
end_link_name:
str# The name of the end-effector link for the solver.
This defines the target link for forward/inverse kinematics calculations. Must match a link name in the URDF file.
- classmethod from_dict(init_dict)#
Initialize the concrete solver configuration from a dictionary.
The concrete config receives all recognized dataclass init fields in its constructor so initialization and
__post_init__observe the final inputs exactly once. Legacy unannotated config attributes are applied afterward. Unknown fields preserve the historical behavior: they are ignored with a warning.- Return type:
-
ik_nearest_weight:
Optional[List[float]]# Weights for the inverse kinematics nearest calculation.
The weights influence how the solver prioritizes closeness to the seed position when multiple solutions are available.
- abstract init_solver(device, **kwargs)#
- Return type:
-
joint_names:
list[str] |None# List of joint names for the solver.
If None, all joints in the URDF will be used. If specified, only these named joints will be included in the kinematic chain.
-
root_link_name:
str# The name of the root/base link for the solver.
This defines the starting point of the kinematic chain. Must match a link name in the URDF file.
-
tcp:
Tensor|ndarray# The tool center point (TCP) position as a 4x4 homogeneous matrix.
This represents the position and orientation of the tool in the robot’s end-effector frame.
-
urdf_path:
str|None# The file path to the URDF model of the robot.
-
user_qpos_limits:
Optional[List[float]]# User defined Joint position limits [2, DOF] for the solver. If not provided (None), this value will replace by joint limits defined in urdf when solver init from robot. If provided, the solver will use the intersection of user defined limits and urdf limits as the final joint limits.
-
class_type:
- attrs: RigidBodyAttributesCfg#
Physical attributes for all links. We use default mass from the USD/URDF file if available. The mass and density in attrs will only be used if specified.
- body_scale: tuple | list#
Scale of the articulation in the simulation world frame.
- build_pk_chain: bool#
Whether to build pytorch-kinematics chain for forward kinematics and jacobian computation.
- build_pk_serial_chain(device=device(type='cpu'), **kwargs)[source]#
Build the serial chain from the URDF file.
Note
This method is usually used in imitation dataset saving (compute eef pose from qpos using FK) and model training (provide a differentiable FK layer or loss computation).
- Parameters:
device (torch.device) – The device to which the chain will be moved. Defaults to CPU.
**kwargs – Additional arguments for building the serial chain.
- Returns:
The serial chain of the robot for specified control part.
- Return type:
Dict[str, pk.SerialChain]
- compute_uv: bool#
Whether to compute the UV mapping for the articulation link.
Currently, the uv mapping is computed for each link with projection uv mapping method.
- control_parts: Dict[str, List[str]] | None#
Control parts is the mapping from part name to joint names.
For example, {‘left_arm’: [‘joint1’, ‘joint2’], ‘right_arm’: [‘joint3’, ‘joint4’]} If no control part is specified, the robot will use all joints as a single control part.
Note
- control_parts can be used without solver_cfg. If solver_cfg is a
dictionary, its keys must correspond to control-part names.
- The joint names in the control parts support regular expressions, e.g., ‘joint[1-6]’.
After initialization of robot, the names will be expanded to a list of full joint names.
- Robot is a derived class of Articulation, with control parts support. So the drive_pros
in ArticulationCfg can use control part as key to specify the corresponding joint drive properties, which will be overridden if these joint names are already specified.
- disable_self_collision: bool#
Whether to enable or disable self-collisions.
- drive_pros: JointDrivePropertiesCfg#
Properties to define the drive mechanism of a joint.
- enable_gravity: bool#
Whether gravity is enabled for the articulation.
This runtime flag is applied regardless of
use_usd_properties.
- fix_base: bool#
Whether to fix the base of the articulation.
Set to True for articulations that should not move, such as a fixed base robot arm or a door. Set to False for articulations that should move freely, such as a mobile robot or a humanoid robot.
- fpath: str#
Path to the articulation asset file.
- classmethod from_dict(init_dict)[source]#
Initialize the configuration from a dictionary.
- Return type:
- init_local_pose: np.ndarray | None#
4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
- init_pos: tuple[float, float, float]#
Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- init_qpos: torch.Tensor | np.ndarray | Sequence[float]#
Initial joint positions of the articulation.
If None, the joint positions will be set to zero. If provided, it should be a array of shape (num_joints,).
- init_rot: tuple[float, float, float]#
Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
- link_attrs: dict[str, LinkPhysicsOverrideCfg] | None#
Named per-link physics override groups keyed by regex on link names.
Each group applies
LinkPhysicsOverrideCfg.attrson top ofattrsfor matched links only. A link must not match more than one group.
- min_position_iters: int#
[1,255].
- Type:
Number of position iterations the solver should perform for this articulation. Range
- min_velocity_iters: int#
[0,255].
- Type:
Number of velocity iterations the solver should perform for this articulation. Range
- qpos_limits: torch.Tensor | np.ndarray | Sequence[float] | Dict[str, List[float]] | None#
Override joint position limits of the articulation.
If None, the joint position limits from the asset file (URDF/USD) are used. If provided as a tensor/array of shape (num_joints, 2), it is applied to all joints in the order of
joint_names. If provided as a dictionary, keys are joint names or regular expressions and values are[min, max]limits.This field replaces the asset limits for the articulation and can be used to either tighten or expand the allowed range.
- sleep_threshold: float#
[0, max_float32]
- Type:
Energy below which the articulation may go to sleep. Range
- solver_cfg: SolverCfg | Dict[str, SolverCfg] | None#
Solver is used to compute forward and inverse kinematics for the robot.
- uid: str | None#
- urdf_cfg: URDFCfg | None#
URDF assembly configuration which allows for assembling a robot from multiple URDF components.
- use_usd_properties: bool#
Whether to use physical properties from USD file instead of config.
When True: Keep all physical properties (drive, physics attrs, etc.) from USD file. When False (default): Override USD properties with config values (URDF behavior). Only effective for USD files, ignored for URDF files.
- workspace_cfg: Dict[str, RobotWorkspaceCfg] | None#
Runtime workspace cache configuration keyed by control-part name.
- class embodichain.lab.sim.cfg.SoftObjectCfg[source]#
Bases:
ObjectBaseCfgConfiguration for a soft body asset in the simulation.
This class extends the base asset configuration to include specific properties for soft bodies, such as physical attributes and collision group.
Attributes:
4x4 transformation matrix of the root in local frame.
Position of the root in simulation world frame.
Euler angles (in degree) of the root in simulation world frame.
Physical attributes for the soft body.
Mesh configuration for the soft body.
Tetra mesh voxelization attributes for the soft body.
-
init_local_pose:
ndarray|None# 4x4 transformation matrix of the root in local frame. If specified, it will override init_pos and init_rot.
-
init_pos:
tuple[float,float,float]# Position of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
init_rot:
tuple[float,float,float]# Euler angles (in degree) of the root in simulation world frame. Defaults to (0.0, 0.0, 0.0).
-
physical_attr:
SoftbodyPhysicalAttributesCfg# Physical attributes for the soft body.
-
uid:
str|None#
-
voxel_attr:
SoftbodyVoxelAttributesCfg# Tetra mesh voxelization attributes for the soft body.
-
init_local_pose:
- class embodichain.lab.sim.cfg.SoftbodyPhysicalAttributesCfg[source]#
Bases:
objectSoftbodyPhysicalAttributesCfg(youngs: ‘float’ = <factory>, poissons: ‘float’ = <factory>, dynamic_friction: ‘float’ = <factory>, elasticity_damping: ‘float’ = <factory>, material_model: ‘SoftBodyMaterialModel’ = <factory>, enable_kinematic: ‘bool’ = <factory>, enable_ccd: ‘bool’ = <factory>, enable_self_collision: ‘bool’ = <factory>, has_gravity: ‘bool’ = <factory>, self_collision_stress_tolerance: ‘float’ = <factory>, collision_mesh_simplification: ‘bool’ = <factory>, self_collision_filter_distance: ‘float’ = <factory>, vertex_velocity_damping: ‘float’ = <factory>, linear_damping: ‘float’ = <factory>, sleep_threshold: ‘float’ = <factory>, settling_threshold: ‘float’ = <factory>, settling_damping: ‘float’ = <factory>, mass: ‘float’ = <factory>, density: ‘float’ = <factory>, max_depenetration_velocity: ‘float’ = <factory>, max_velocity: ‘float’ = <factory>, min_position_iters: ‘int’ = <factory>, min_velocity_iters: ‘int’ = <factory>)
Methods:
attr()Attributes:
Whether to simplify the collision mesh for self-collision.
Material density in kg/m^3.
Dynamic friction coefficient.
Elasticity damping factor.
Enable continuous collision detection (CCD).
If True, (partially) kinematic behavior is enabled.
Enable self-collision handling.
Whether the soft body is affected by gravity.
Global linear damping applied to the soft body.
Total mass of the soft body.
Material constitutive model.
Maximum velocity used to resolve penetrations.
Clamp for linear (or vertex) velocity.
Minimum solver iterations for position correction.
Minimum solver iterations for velocity updates.
Poisson's ratio (higher = closer to incompressible).
Distance threshold below which vertex pairs may be filtered from self-collision checks.
Stress tolerance threshold for self-collision constraints.
Additional damping applied during settling phase.
Threshold used to decide convergence/settling state.
Velocity/energy threshold below which the soft body can go to sleep.
Per-vertex velocity damping.
Young's modulus (higher = stiffer).
-
collision_mesh_simplification:
bool# Whether to simplify the collision mesh for self-collision.
-
density:
float# Material density in kg/m^3.
-
dynamic_friction:
float# Dynamic friction coefficient.
-
elasticity_damping:
float# Elasticity damping factor.
-
enable_ccd:
bool# Enable continuous collision detection (CCD).
-
enable_kinematic:
bool# If True, (partially) kinematic behavior is enabled.
-
enable_self_collision:
bool# Enable self-collision handling.
-
has_gravity:
bool# Whether the soft body is affected by gravity.
-
linear_damping:
float# Global linear damping applied to the soft body.
-
mass:
float# Total mass of the soft body. If set to a negative value, density will be used to compute mass.
-
material_model:
SoftBodyMaterialModel# Material constitutive model.
-
max_depenetration_velocity:
float# Maximum velocity used to resolve penetrations. Must be larger than zero.
-
max_velocity:
float# Clamp for linear (or vertex) velocity. If set to zero, the limit is ignored.
-
min_position_iters:
int# Minimum solver iterations for position correction.
-
min_velocity_iters:
int# Minimum solver iterations for velocity updates.
-
poissons:
float# Poisson’s ratio (higher = closer to incompressible).
-
self_collision_filter_distance:
float# Distance threshold below which vertex pairs may be filtered from self-collision checks.
-
self_collision_stress_tolerance:
float# Stress tolerance threshold for self-collision constraints.
-
settling_damping:
float# Additional damping applied during settling phase.
-
settling_threshold:
float# Threshold used to decide convergence/settling state.
-
sleep_threshold:
float# Velocity/energy threshold below which the soft body can go to sleep.
-
vertex_velocity_damping:
float# Per-vertex velocity damping.
-
youngs:
float# Young’s modulus (higher = stiffer).
-
collision_mesh_simplification:
- class embodichain.lab.sim.cfg.SoftbodyVoxelAttributesCfg[source]#
Bases:
objectSoftbodyVoxelAttributesCfg(triangle_remesh_resolution: ‘int’ = <factory>, triangle_simplify_target: ‘int’ = <factory>, maximal_edge_length: ‘float’ = <factory>, simulation_mesh_resolution: ‘int’ = <factory>, simulation_mesh_output_obj: ‘bool’ = <factory>)
Methods:
attr()Convert to dexsim VoxelConfig
Attributes:
Whether to output the simulation mesh as an obj file for debugging.
Resolution to build simulation voxelize textra mesh.
Resolution to remesh the softbody mesh before building physics collision mesh.
Simplify mesh faces to target value.
-
maximal_edge_length:
float#
-
simulation_mesh_output_obj:
bool# Whether to output the simulation mesh as an obj file for debugging.
-
simulation_mesh_resolution:
int# Resolution to build simulation voxelize textra mesh. This value must be greater than 0.
-
triangle_remesh_resolution:
int# Resolution to remesh the softbody mesh before building physics collision mesh.
-
triangle_simplify_target:
int# Simplify mesh faces to target value. Do nothing if this value is zero.
-
maximal_edge_length:
- class embodichain.lab.sim.cfg.URDFCfg[source]#
Bases:
objectStandalone configuration class for URDF assembly.
Methods:
add_component(component_type, urdf_path[, ...])Add a robot component to the assembly configuration.
add_sensor(sensor_name, **sensor_config)Add a sensor to the robot configuration.
Assemble URDF files for the robot based on the configuration.
from_dict(init_dict)set_urdf(urdf_path)Directly specify a single URDF file for the robot, compatible with the single-URDF robot case.
Attributes:
Name of the base link in the assembled robot.
Component name prefixes used during URDF assembly.
Dictionary of robot components to be assembled.
Name used for output file and directory.
Full output file path for the assembled URDF.
Output directory prefix for the assembled URDF file.
Case normalization policy applied to joint/link names during URDF assembly.
Dictionary of sensors to be attached to the robot.
Whether to use signature check when merging URDFs.
- add_component(component_type, urdf_path, transform=None, **params)[source]#
Add a robot component to the assembly configuration.
- Parameters:
component_type (str) – The type/name of the component. Should be one of SUPPORTED_COMPONENTS (e.g., ‘chassis’, ‘torso’, ‘head’, ‘left_arm’, ‘right_hand’, ‘arm’, ‘hand’, etc.).
urdf_path (str) – Path to the component’s URDF file.
transform (np.ndarray | None) – 4x4 transformation matrix for the component in the robot frame (default: None).
**params – Additional keyword parameters for the component (e.g., color, material, etc.).
- Returns:
Returns self to allow method chaining.
- Return type:
- add_sensor(sensor_name, **sensor_config)[source]#
Add a sensor to the robot configuration.
- Parameters:
sensor_name (str) – The name of the sensor.
**sensor_config – Additional configuration parameters for the sensor.
- Returns:
Returns self to allow method chaining.
- Return type:
- assemble_urdf()[source]#
Assemble URDF files for the robot based on the configuration.
- Returns:
The path to the resulting (possibly merged) URDF file.
- Return type:
str
-
base_link_name:
str# Name of the base link in the assembled robot.
-
component_prefix:
List[tuple[str,str|None]]# Component name prefixes used during URDF assembly.
Preferred form is a list of
(component_name, prefix)tuples. For convenience, a mapping{component_name: prefix}is also accepted when constructingURDFCfgand will be normalized internally.
-
components:
Dict[str,Dict[str,Union[str,Dict,ndarray]]]# Dictionary of robot components to be assembled.
-
fname:
str|None# Name used for output file and directory. If not specified, auto-generated from component names.
-
fpath:
str|None# Full output file path for the assembled URDF. If specified, overrides fname and fpath_prefix.
-
fpath_prefix:
str# Output directory prefix for the assembled URDF file.
-
name_case:
dict[str,str]# Case normalization policy applied to joint/link names during URDF assembly.
Supported values per key are
"upper","lower"or"original"(legacy alias"none"). The default preserves source URDF casing.
-
sensors:
Dict[str,Dict[str,str|ndarray]]# Dictionary of sensors to be attached to the robot.
- set_urdf(urdf_path)[source]#
Directly specify a single URDF file for the robot, compatible with the single-URDF robot case.
- Parameters:
urdf_path (str) – Path to the robot’s URDF file.
- Returns:
Returns self to allow method chaining.
- Return type:
-
use_signature_check:
bool# Whether to use signature check when merging URDFs.
- class embodichain.lab.sim.cfg.WindowCameraPoseCfg[source]#
Bases:
objectConfiguration for printing the interactive viewer camera pose.
Attributes:
Whether the hotkey prints a
set_look_atcall instead of a matrix.Whether to register the
photkey when the window opens.-
convert_to_look_at:
bool# Whether the hotkey prints a
set_look_atcall instead of a matrix.
-
enable_hotkey:
bool# Whether to register the
photkey when the window opens.
-
convert_to_look_at:
- class embodichain.lab.sim.cfg.WindowRecordCfg[source]#
Bases:
objectConfiguration for interactive viewer window recording.
Attributes:
Whether to register the
rhotkey for viewer recording when the window opens.Frames per second for viewer recording.
Maximum buffered recording memory in MB before auto-stopping capture.
Optional output path for viewer recordings.
Video file prefix used when no explicit save path is provided.
-
enable_hotkey:
bool# Whether to register the
rhotkey for viewer recording when the window opens.
-
fps:
int# Frames per second for viewer recording.
-
max_memory:
int# Maximum buffered recording memory in MB before auto-stopping capture.
-
save_path:
str|None# Optional output path for viewer recordings. If None, use the default outputs directory.
-
video_prefix:
str# Video file prefix used when no explicit save path is provided.
-
enable_hotkey:
- embodichain.lab.sim.cfg.link_attrs_from_dict(value)[source]#
Parse a
link_attrsmapping from YAML/JSON-style dicts.- Return type:
dict[str,LinkPhysicsOverrideCfg]
Common Components#
Materials#
Shapes#
Objects#
Sensors#
Robot Configurations#
Robot Motion#
Atomic Actions#
Shared Types#
Utility#
DLSS Configuration#
Configure window and offscreen Ray Reconstruction and Super Resolution through
SimulationManagerCfg.render_cfg.dlss. Output resolution remains owned by the
window or camera configuration.
- class embodichain.lab.sim.DLSSCfg[source]#
DexSim DLSS configuration for window and offscreen rendering.
Ray Reconstruction (RR) and Super Resolution (SR) are independently configurable on the
"hybrid","fast-rt", and"rt"renderers. DLSS is enabled by default for both windows and offscreen cameras. Offscreen DLSS also requires the master switch to remain enabled.Attention
DLSS requires a Vulkan render device, a compatible NVIDIA GPU/driver, and a DexSim build with the NGX runtime. Initialization is deferred until rendering; configuration conversion alone cannot verify support. Each enabled offscreen camera needs its own temporal history and Vulkan exchange images, increasing GPU memory use.
Methods:
__init__([dlss_enabled, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dexsim_cfg(window_width, window_height)Convert settings without changing the window or camera output size.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
Master switch for DLSS.
-1auto (58%),0Ultra Performance (~33%),1Performance (50%),2Balanced (58%),3Quality (~67%),4Ultra Quality (77%),5DLAA (100%).Positive, finite exposure multiplier used by the RR bridge.
Frame interval in milliseconds passed to DexSim's DLSS temporal path.
Enable DLSS for offscreen cameras, including in headless simulations.
Enable RR denoising.
Internal FastRT/OfflineRT window height; zero derives it from quality.
Internal FastRT/OfflineRT window width; zero derives it from quality.
DexSim compatibility field.
DexSim compatibility field.
Optional window target/render ratio, at least 1.0.
Enable SR upscaling.
- __init__(dlss_enabled=<factory>, offscreen_dlss_enabled=<factory>, rayreconstruction_enabled=<factory>, upscale_enabled=<factory>, dlss_quality=<factory>, upsample_ratio=<factory>, render_width=<factory>, render_height=<factory>, target_width=<factory>, target_height=<factory>, exposure_compensation=<factory>, frame_time_delta_ms=<factory>)#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
dlss_enabled:
bool# Master switch for DLSS. False retains the standard rendering path.
-
dlss_quality:
int# -1auto (58%),0Ultra Performance (~33%),1Performance (50%),2Balanced (58%),3Quality (~67%),4Ultra Quality (77%),5DLAA (100%).- Type:
Quality mode and derived internal scale
-
exposure_compensation:
float# Positive, finite exposure multiplier used by the RR bridge.
-
frame_time_delta_ms:
float# Frame interval in milliseconds passed to DexSim’s DLSS temporal path.
The default
0.0intentionally matchesdexsim.DLSSConfig: DexSim measures the actual render interval automatically. Set a positive value only for a fixed render cadence; this is a render-frame interval, not a physics or control timestep.
-
offscreen_dlss_enabled:
bool# Enable DLSS for offscreen cameras, including in headless simulations.
-
rayreconstruction_enabled:
bool# Enable RR denoising. Can be used without SR at the target resolution.
-
render_height:
int# Internal FastRT/OfflineRT window height; zero derives it from quality.
-
render_width:
int# Internal FastRT/OfflineRT window width; zero derives it from quality.
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
target_height:
int# DexSim compatibility field. Set the actual window or camera height instead.
-
target_width:
int# DexSim compatibility field. Set the actual window or camera width instead.
- to_dexsim_cfg(window_width, window_height)[source]#
Convert settings without changing the window or camera output size.
- Parameters:
window_width (
int) – Window width in pixels.window_height (
int) – Window height in pixels.
- Return type:
DLSSConfig- Returns:
Populated
dexsim.DLSSConfiginstance ready to assign toworld_config.dlss_config.- Raises:
ValueError – If the configuration contains invalid values.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
-
upsample_ratio:
float|None# Optional window target/render ratio, at least 1.0. None leaves zero render dimensions for DexSim to derive from quality. When specified, computes each unset render dimension from the actual window size. Only FastRT/OfflineRT windows honor these overrides; hybrid and offscreen targets derive their internal resolution from quality.
-
upscale_enabled:
bool# Enable SR upscaling. Can be used independently of RR.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.