Skip to content

Commit 58fe376

Browse files
authored
Upgrade dexsim to v0.3.8 (#53)
1 parent 81fe841 commit 58fe376

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+86
-138
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![License](https://img.shields.io/github/license/DexForce/EmbodiChain)](LICENSE)
66
[![GitHub Pages](https://img.shields.io/badge/GitHub%20Pages-docs-blue?logo=github&logoColor=white)](https://dexforce.github.io/EmbodiChain/introduction.html)
7-
[![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html)
7+
[![Python](https://img.shields.io/badge/python-3.10%20|%203.11-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html)
88
[![Version](https://img.shields.io/badge/version-0.0.1-blue.svg)](https://github.com/DexForce/EmbodiChain/releases)
99

1010
---

docs/source/features/workspace_analyzer/workspace_analyzer.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ from embodichain.lab.sim.utility.workspace_analyzer import (
2525

2626
# Setup simulation
2727
sim = SimulationManager(SimulationManagerCfg(headless=False, sim_device="cpu"))
28-
sim.build_multiple_arenas(1)
2928

3029
# Add robot
3130
robot = sim.add_robot(DexforceW1Cfg.from_dict({
@@ -169,7 +168,6 @@ from embodichain.lab.sim.utility.workspace_analyzer.configs import Visualization
169168

170169
# Setup simulation
171170
sim = SimulationManager(SimulationManagerCfg(headless=False, sim_device="cpu"))
172-
sim.build_multiple_arenas(1)
173171

174172
# Add robot
175173
robot = sim.add_robot(DexforceW1Cfg.from_dict({

docs/source/quick_start/install.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44

55
The following minimum system requirements are recommended to run EmbodiChain reliably. These are the tested configurations during development — other Linux distributions and versions may work but are not officially supported.
66

7-
- Operating System: Linux (x86_64)
8-
- Recommended distributions: Ubuntu 20.04 LTS or Ubuntu 22.04 LTS
7+
- Operating System:
8+
- Linux (x86_64): Ubuntu 20.04+
99

1010
- NVIDIA GPU and drivers:
11-
- Hardware: NVIDIA GPU with compute capability 7.0 or higher (e.g., RTX 20 series, RTX 30 series, A100, etc.)
12-
- NVIDIA driver: 535 or higher (recommended 570)
13-
- CUDA Toolkit: any of 11.8 — 12.8 (we test primarily with 11.8 and 12.x)
11+
- Hardware: NVIDIA GPU with compute capability 7.0 or higher
12+
- NVIDIA Driver: 535 or higher (recommended 570)
13+
1414

1515
- Python:
16-
- Supported Python versions:
17-
- Python 3.10
18-
- Use a virtual environment (venv, virtualenv, or conda) to isolate dependencies
16+
- 3.10
17+
- 3.11
1918

2019
Notes:
2120

22-
- Ensure your NVIDIA driver and CUDA toolkit versions are compatible with your chosen PyTorch wheel.
21+
- Ensure your NVIDIA driver is compatible with your chosen PyTorch wheel.
2322
- We recommend installing PyTorch from the official PyTorch instructions for your CUDA version: https://pytorch.org/get-started/locally/
2423

2524
---

docs/source/resources/robot/cobotmagic.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ CobotMagic is a versatile dual-arm collaborative robot developed by AgileX Robot
3939
from embodichain.lab.sim import SimulationManager, SimulationManagerCfg
4040
from embodichain.lab.sim.robots import CobotMagicCfg
4141

42-
config = SimulationManagerCfg(headless=False, sim_device="cpu")
42+
config = SimulationManagerCfg(headless=False, sim_device="cpu", num_envs=2)
4343
sim = SimulationManager(config)
44-
sim.build_multiple_arenas(2) # Supports parallel simulation in multiple arenas
4544
sim.set_manual_update(False)
4645

4746
robot = sim.add_robot(cfg=CobotMagicCfg().from_dict({}))

docs/source/tutorial/create_scene.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ Command-line arguments are parsed using ``argparse`` to allow for easy customiza
3131
.. literalinclude:: ../../../scripts/tutorials/sim/create_scene.py
3232
:language: python
3333
:start-at: # Parse command line arguments
34-
:end-at: sim.build_multiple_arenas(args.num_envs, space=3.0)
34+
:end-at: sim = SimulationManager(sim_cfg)
3535

3636
There are two kinds of physics mode in :class:`SimulationManager`:
3737

3838
- `manual`: The physics updates only when the user calls the :meth:`SimulationManager.update` function. This mode is used for robot learning tasks where precise control over simulation steps is required. Enabled by setting :meth:`SimulationManager.set_manual_update` to True.
3939
- `auto`: The physics updates in a standalone thread, which enable asynchronous rendering and physics stepping. This mode is suitable for visualizations and demos for digital twins applications. This is the default mode.
4040

41-
If `num_envs` is greater than 1, :meth:`SimulationManager.build_multiple_arenas` should be used to create multiple simulation arenas.
42-
4341
Adding objects to the scene
4442
---------------------------
4543

docs/source/tutorial/create_softbody.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ The first step is to configure the simulation environment. This is done using th
3232
:start-at: # Configure the simulation
3333
:end-at: print("[INFO]: Scene setup complete!")
3434

35-
If ``num_envs`` is greater than 1, :meth:`SimulationManager.build_multiple_arenas` should be used to create multiple simulation arenas.
36-
3735
Adding a soft body to the scene
3836
-------------------------------
3937

docs/source/tutorial/rl.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ To start training, run:
182182

183183
.. code-block:: bash
184184
185-
python embodichain/agents/rl/train.py --config configs/agents/rl/push_cube/train_config.json
185+
python -m embodichain.agents.rl.train --config configs/agents/rl/push_cube/train_config.json
186186
187187
Outputs
188188
-------

embodichain/lab/gym/envs/base_env.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def __init__(
109109
self.sim_cfg = SimulationManagerCfg(headless=True)
110110
else:
111111
self.sim_cfg = self.cfg.sim_cfg
112+
self.sim_cfg.num_envs = self.num_envs
112113

113114
if self.cfg.seed is not None:
114115
self.cfg.seed = set_seed(self.cfg.seed)
@@ -208,8 +209,6 @@ def _setup_scene(self, **kwargs):
208209
logger.log_info(
209210
f"Initializing {self.num_envs} environments on {self.sim_cfg.sim_device}."
210211
)
211-
if self.num_envs > 1:
212-
self.sim.build_multiple_arenas(self.num_envs)
213212

214213
self.robot = self._setup_robot(**kwargs)
215214
if self.robot is None:

embodichain/lab/sim/objects/articulation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ def set_local_pose(
797797
# we should keep `pose_` life cycle to the end of the function.
798798
pose_ = torch.cat((quat, xyz), dim=-1)
799799
indices = self.body_data.gpu_indices[local_env_ids]
800-
torch.cuda.synchronize(self.device)
801800
self._ps.gpu_apply_root_data(
802801
data=pose_,
803802
gpu_indices=indices,
@@ -981,7 +980,6 @@ def set_qpos(
981980
indices = self.body_data.gpu_indices[local_env_ids]
982981
qpos_set = self.body_data._qpos[local_env_ids]
983982
qpos_set[:, local_joint_ids] = qpos
984-
torch.cuda.synchronize(self.device)
985983
self._ps.gpu_apply_joint_data(
986984
data=qpos_set,
987985
gpu_indices=indices,
@@ -1045,7 +1043,6 @@ def set_qvel(
10451043
self.body_data.qvel
10461044
qvel_set = self.body_data._qvel[local_env_ids]
10471045
qvel_set[:, joint_ids] = qvel
1048-
torch.cuda.synchronize(self.device)
10491046
self._ps.gpu_apply_joint_data(
10501047
data=qvel_set,
10511048
gpu_indices=indices,
@@ -1086,7 +1083,6 @@ def set_qf(
10861083
self.body_data.qf
10871084
qf_set = self.body_data._qf[local_env_ids]
10881085
qf_set[:, joint_ids] = qf
1089-
torch.cuda.synchronize(self.device)
10901086
self._ps.gpu_apply_joint_data(
10911087
data=qf_set,
10921088
gpu_indices=indices,
@@ -1167,13 +1163,11 @@ def clear_dynamics(self, env_ids: Sequence[int] | None = None) -> None:
11671163
(len(local_env_ids), self.dof), dtype=torch.float32, device=self.device
11681164
)
11691165
indices = self.body_data.gpu_indices[local_env_ids]
1170-
torch.cuda.synchronize(self.device)
11711166
self._ps.gpu_apply_joint_data(
11721167
data=zeros,
11731168
gpu_indices=indices,
11741169
data_type=ArticulationGPUAPIWriteType.JOINT_VELOCITY,
11751170
)
1176-
torch.cuda.synchronize(self.device)
11771171
self._ps.gpu_apply_joint_data(
11781172
data=zeros,
11791173
gpu_indices=indices,

embodichain/lab/sim/robots/cobotmagic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,8 @@ def build_pk_serial_chain(
207207

208208
torch.set_printoptions(precision=5, sci_mode=False)
209209

210-
config = SimulationManagerCfg(headless=False, sim_device="cuda")
210+
config = SimulationManagerCfg(headless=False, sim_device="cuda", num_envs=2)
211211
sim = SimulationManager(config)
212-
sim.build_multiple_arenas(2)
213212

214213
config = {
215214
"init_pos": [0.0, 0.0, 1.0],

0 commit comments

Comments
 (0)