You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/overview/sim/sim_assets.md
+44-23Lines changed: 44 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,10 @@
1
1
# Simulation Assets
2
2
3
-
Simulation assets in EmbodiChain are configured using Python dataclasses. This approach provides a structured and type-safe way to define properties for physics, materials, objects and sensors in the simulation environment.
3
+
Simulation assets in EmbodiChain are configured using Python dataclasses. This approach provides a structured and type-safe way to define properties for physics, materials, objects and sensors in the simulation environment.
4
4
5
-
## Physics Configuration
5
+
## Visual Materials
6
6
7
-
The `PhysicsCfg` class controls the global physics simulation parameters.
8
-
9
-
| Parameter | Type | Default | Description |
10
-
| :--- | :--- | :--- | :--- |
11
-
|`gravity`|`np.ndarray`|`[0, 0, -9.81]`| Gravity vector for the simulation environment. |
12
-
|`bounce_threshold`|`float`|`2.0`| The speed threshold below which collisions will not produce bounce effects. |
13
-
|`enable_pcm`|`bool`|`True`| Enable persistent contact manifold (PCM) for improved collision handling. |
14
-
|`enable_tgs`|`bool`|`True`| Enable temporal gauss-seidel (TGS) solver for better stability. |
15
-
|`enable_ccd`|`bool`|`False`| Enable continuous collision detection (CCD) for fast-moving objects. |
16
-
|`enable_enhanced_determinism`|`bool`|`False`| Enable enhanced determinism for consistent simulation results. |
17
-
|`enable_friction_every_iteration`|`bool`|`True`| Enable friction calculations at every solver iteration. |
18
-
|`length_tolerance`|`float`|`0.05`| The length tolerance for the simulation. Larger values increase speed. |
19
-
|`speed_tolerance`|`float`|`0.25`| The speed tolerance for the simulation. Larger values increase speed. |
20
-
21
-
## Materials
22
-
23
-
### Visual Materials
7
+
### Configuration
24
8
25
9
The `VisualMaterialCfg` class defines the visual appearance of objects using Physically Based Rendering (PBR) properties.
26
10
@@ -38,13 +22,43 @@ The `VisualMaterialCfg` class defines the visual appearance of objects using Phy
38
22
|`normal_texture`|`str`|`None`| Path to normal map. |
39
23
|`ao_texture`|`str`|`None`| Path to ambient occlusion map. |
40
24
|`ior`|`float`|`1.5`| Index of refraction for ray tracing materials. |
41
-
|`material_type`|`str`|`"BRDF"`| material type. |
25
+
26
+
### Visual Material and Visual Material Instance
27
+
28
+
A visual material is defined using the `VisualMaterialCfg` class. It is actually a material template that can be used to create multiple instances with different parameters.
29
+
30
+
A visual material instance is created from a visual material using the method `create_instance()`. User can set different properties for each instance. For details API usage, please refer to the [VisualMaterialInst](https://dexforce.github.io/EmbodiChain/api_reference/embodichain/embodichain.lab.sim.html#embodichain.lab.sim.material.VisualMaterialInst) documentation.
31
+
32
+
For batch simualtion scenarios, when user set a material to a object (eg, a rigid object), the material instance will be created for each simulation instance automatically.
33
+
34
+
### Code
35
+
36
+
```python
37
+
# Create a visual material with base color white and low roughness.
38
+
mat: VisualMaterial = sim.create_visual_material(
39
+
cfg=VisualMaterialCfg(
40
+
base_color=[1.0, 1.0, 1.0, 1.0],
41
+
roughness=0.05,
42
+
)
43
+
)
44
+
45
+
# Set the material to a rigid object.
46
+
object: RigidObject
47
+
object.set_visual_material(mat)
48
+
49
+
# Get all material instances created for this object in the simulation. If `num_envs` is N, there will be N instances.
|`physics_config`|`PhysicsCfg`|`PhysicsCfg()`| The physics configuration parameters. |
44
44
|`gpu_memory_config`|`GPUMemoryCfg`|`GPUMemoryCfg()`| The GPU memory configuration parameters. |
45
45
46
+
### Physics Configuration
47
+
48
+
The `PhysicsCfg` class controls the global physics simulation parameters.
49
+
50
+
| Parameter | Type | Default | Description |
51
+
| :--- | :--- | :--- | :--- |
52
+
|`gravity`|`np.ndarray`|`[0, 0, -9.81]`| Gravity vector for the simulation environment. |
53
+
|`bounce_threshold`|`float`|`2.0`| The speed threshold below which collisions will not produce bounce effects. |
54
+
|`enable_ccd`|`bool`|`False`| Enable continuous collision detection (CCD) for fast-moving objects. |
55
+
|`length_tolerance`|`float`|`0.05`| The length tolerance for the simulation. Larger values increase speed. |
56
+
|`speed_tolerance`|`float`|`0.25`| The speed tolerance for the simulation. Larger values increase speed. |
57
+
58
+
For more parameters and details, refer to the [PhysicsCfg](https://dexforce.github.io/EmbodiChain/api_reference/embodichain/embodichain.lab.sim.html#embodichain.lab.sim.cfg.PhysicsCfg) documentation.
59
+
60
+
46
61
## Initialization
47
62
48
63
Initialize the manager with the configuration object:
0 commit comments