Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions configs/agents/rl/basic/cart_pole/train_config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
{
"trainer": {
"exp_name": "cart_pole_ppo",
"gym_config": "configs/agents/rl/basic/cart_pole/gym_config.json",
"seed": 42,
"device": "cuda:0",
"headless": true,
"enable_rt": false,
"gpu_id": 0,
"num_envs": 64,
"iterations": 1000,
Expand All @@ -22,30 +21,57 @@
"interval_step": 1,
"params": {
"name": "main_cam",
"resolution": [640, 480],
"eye": [-1.4, 1.4, 2.5],
"target": [0, 0, 0.7],
"up": [0, 0, 1],
"intrinsics": [600, 600, 320, 240],
"resolution": [
640,
480
],
"eye": [
-1.4,
1.4,
2.5
],
"target": [
0,
0,
0.7
],
"up": [
0,
0,
1
],
"intrinsics": [
600,
600,
320,
240
],
"save_path": "./outputs/videos/eval"
}
}
}
}
},
"renderer": "legacy"
},
"policy": {
"name": "actor_critic",
"actor": {
"type": "mlp",
"network_cfg": {
"hidden_sizes": [256, 256],
"hidden_sizes": [
256,
256
],
"activation": "relu"
}
},
"critic": {
"type": "mlp",
"network_cfg": {
"hidden_sizes": [256, 256],
"hidden_sizes": [
256,
256
],
"activation": "relu"
}
}
Expand All @@ -64,4 +90,4 @@
"max_grad_norm": 0.5
}
}
}
}
41 changes: 32 additions & 9 deletions configs/agents/rl/basic/cart_pole/train_config_grpo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"seed": 42,
"device": "cuda:0",
"headless": true,
"enable_rt": false,
"gpu_id": 0,
"num_envs": 64,
"iterations": 1000,
Expand All @@ -23,23 +22,47 @@
"interval_step": 1,
"params": {
"name": "main_cam",
"resolution": [640, 480],
"eye": [-1.4, 1.4, 2.5],
"target": [0, 0, 0.7],
"up": [0, 0, 1],
"intrinsics": [600, 600, 320, 240],
"resolution": [
640,
480
],
"eye": [
-1.4,
1.4,
2.5
],
"target": [
0,
0,
0.7
],
"up": [
0,
0,
1
],
"intrinsics": [
600,
600,
320,
240
],
"save_path": "./outputs/videos/eval"
}
}
}
}
},
"renderer": "legacy"
},
"policy": {
"name": "actor_only",
"actor": {
"type": "mlp",
"network_cfg": {
"hidden_sizes": [256, 256],
"hidden_sizes": [
256,
256
],
"activation": "relu"
}
}
Expand All @@ -55,7 +78,7 @@
"ent_coef": 0.01,
"kl_coef": 0.0,
"group_size": 4,
"eps": 1e-8,
"eps": 1e-08,
"reset_every_rollout": true,
"max_grad_norm": 0.5,
"truncate_at_first_done": true
Expand Down
48 changes: 37 additions & 11 deletions configs/agents/rl/push_cube/train_config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
{
"trainer": {
"exp_name": "push_cube_ppo",
"gym_config": "configs/agents/rl/push_cube/gym_config.json",
"seed": 42,
"device": "cuda:0",
"headless": true,
"enable_rt": false,
"gpu_id": 0,
"num_envs": 64,
"iterations": 1000,
Expand All @@ -25,30 +24,57 @@
"interval_step": 1,
"params": {
"name": "main_cam",
"resolution": [640, 480],
"eye": [-1.4, 1.4, 2.0],
"target": [0, 0, 0],
"up": [0, 0, 1],
"intrinsics": [600, 600, 320, 240],
"resolution": [
640,
480
],
"eye": [
-1.4,
1.4,
2.0
],
"target": [
0,
0,
0
],
"up": [
0,
0,
1
],
"intrinsics": [
600,
600,
320,
240
],
"save_path": "./outputs/videos/eval"
}
}
}
}
},
"renderer": "legacy"
},
"policy": {
"name": "actor_critic",
"actor": {
"type": "mlp",
"network_cfg": {
"hidden_sizes": [256, 256],
"hidden_sizes": [
256,
256
],
"activation": "relu"
}
},
"critic": {
"type": "mlp",
"network_cfg": {
"hidden_sizes": [256, 256],
"hidden_sizes": [
256,
256
],
"activation": "relu"
}
}
Expand All @@ -67,4 +93,4 @@
"max_grad_norm": 0.5
}
}
}
}
2 changes: 1 addition & 1 deletion docs/source/overview/sim/sim_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sim_config = SimulationManagerCfg(
| `width` | `int` | `1920` | The width of the simulation window. |
| `height` | `int` | `1080` | The height of the simulation window. |
| `headless` | `bool` | `False` | Whether to run the simulation in headless mode (no Window). |
| `enable_rt` | `bool` | `False` | Whether to enable ray tracing rendering. |
| `renderer` | `bool` | `False` | Whether to enable ray tracing rendering. |
| `enable_denoiser` | `bool` | `True` | Whether to enable denoising for ray tracing rendering. |
| `spp` | `int` | `64` | Samples per pixel for ray tracing rendering. Only valid when ray tracing is enabled and denoiser is False. |
Comment on lines +36 to 38
Comment on lines +36 to 38
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs table still describes renderer as a bool with default False, and still documents enable_denoiser/spp as top-level SimulationManagerCfg fields. In the code, rendering is now configured via render_cfg: RenderCfg with renderer: Literal[...] and enable_denoiser/spp nested under it. Please update the parameter table to reflect the new API (including the correct type/default).

Suggested change
| `renderer` | `bool` | `False` | Whether to enable ray tracing rendering. |
| `enable_denoiser` | `bool` | `True` | Whether to enable denoising for ray tracing rendering. |
| `spp` | `int` | `64` | Samples per pixel for ray tracing rendering. Only valid when ray tracing is enabled and denoiser is False. |
| `render_cfg` | `RenderCfg` | `RenderCfg()` | Rendering configuration (renderer type, denoiser, samples per pixel, and other rendering options). |

Copilot uses AI. Check for mistakes.
| `gpu_id` | `int` | `0` | The gpu index that the simulation engine will be used. Affects gpu physics device. |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial/gizmo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Command-line options:
- ``--device cpu|cuda``: Choose simulation device
- ``--num_envs N``: Number of parallel environments
- ``--headless``: Run without GUI for automated testing
- ``--enable_rt``: Enable ray tracing for better visuals
- ``--renderer``: Enable ray tracing for better visuals
Comment on lines 213 to +216
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs say --renderer "Enable ray tracing" but the flag actually selects the backend and requires a value (legacy/hybrid/fast-rt). Update wording and example usage to reflect this (e.g. --renderer fast-rt).

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI docs list --renderer as a flag (“Enable ray tracing…”), but the actual argument expects a value (legacy|hybrid|fast-rt). Update this bullet to document the accepted values (and that legacy disables RT).

Suggested change
- ``--renderer``: Enable ray tracing for better visuals
- ``--renderer legacy|hybrid|fast-rt``: Select renderer backend (``legacy`` disables ray tracing)

Copilot uses AI. Check for mistakes.

Comment on lines +216 to 217
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI option is now --renderer with explicit choices, but this bullet reads like a boolean toggle. Consider documenting it as --renderer {legacy,hybrid,fast-rt} and explaining what each value does (and/or the default) to match the new argparse contract.

Suggested change
- ``--renderer``: Enable ray tracing for better visuals
- ``--renderer {legacy,hybrid,fast-rt}``: Select rendering backend (default: ``fast-rt``)
- ``legacy``: Classic rasterized renderer, compatible with older hardware
- ``hybrid``: Mixed rasterization and ray tracing for balanced quality and performance
- ``fast-rt``: Optimized real-time ray tracing for highest visual quality

Copilot uses AI. Check for mistakes.
Once running:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial/robot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ You can customize the simulation with various command-line options:
python scripts/tutorials/sim/create_robot.py --headless

# Enable ray tracing rendering
python scripts/tutorials/sim/create_robot.py --enable_rt
python scripts/tutorials/sim/create_robot.py --renderer
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation shows --renderer without a value. Since --renderer expects a backend name (legacy/hybrid/fast-rt), update the example to pass a value (e.g. --renderer hybrid).

Suggested change
python scripts/tutorials/sim/create_robot.py --renderer
python scripts/tutorials/sim/create_robot.py --renderer hybrid

Copilot uses AI. Check for mistakes.

Comment on lines 118 to 120
The simulation will show the robot moving through different poses, demonstrating basic joint control capabilities.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial/sensor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ You can customize the simulation with the following command-line options:
python scripts/tutorials/sim/create_sensor.py --headless

# Enable ray tracing rendering
python scripts/tutorials/sim/create_sensor.py --enable_rt
python scripts/tutorials/sim/create_sensor.py --renderer
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation shows --renderer without a value. Since --renderer takes a choice (legacy/hybrid/fast-rt), the example should include an explicit value (e.g. --renderer fast-rt).

Suggested change
python scripts/tutorials/sim/create_sensor.py --renderer
python scripts/tutorials/sim/create_sensor.py --renderer fast-rt

Copilot uses AI. Check for mistakes.

# Attach the camera to the robot end-effector
python scripts/tutorials/sim/create_sensor.py --attach_sensor
Expand Down
1 change: 1 addition & 0 deletions docs/sync_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Idempotent copy. Exit code 0 on success.
"""

import shutil
from pathlib import Path
import sys
Expand Down
1 change: 0 additions & 1 deletion embodichain/agents/datasets/online_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from embodichain.agents.engine.data import OnlineDataEngine
from embodichain.agents.datasets.sampler import ChunkSizeSampler


__all__ = [
"OnlineDataset",
]
Expand Down
1 change: 0 additions & 1 deletion embodichain/agents/datasets/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from abc import ABC, abstractmethod
from typing import Callable, Iterator, List, Optional, Union


__all__ = [
"ChunkSizeSampler",
"UniformChunkSampler",
Expand Down
3 changes: 2 additions & 1 deletion embodichain/agents/engine/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from tensordict import TensorDict
from tqdm import tqdm

from embodichain.lab.sim.cfg import RenderCfg
from embodichain.utils.logger import log_info, log_error
from embodichain.utils import configclass

Expand Down Expand Up @@ -112,7 +113,7 @@ def _sim_worker_fn(
env_cfg.sim_cfg = SimulationManagerCfg(
headless=gym_config.get("headless", True),
sim_device=gym_config.get("device", "cpu"),
enable_rt=gym_config.get("enable_rt", True),
render_cfg=RenderCfg(renderer=gym_config.get("renderer", "legacy")),
gpu_id=gym_config.get("gpu_id", 0),
)

Expand Down
1 change: 0 additions & 1 deletion embodichain/agents/rl/models/mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import torch
import torch.nn as nn


ActivationName = Union[str, None]


Expand Down
14 changes: 7 additions & 7 deletions embodichain/agents/rl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from embodichain.utils.utility import load_json
from embodichain.utils.module_utils import find_function_from_modules
from embodichain.lab.sim import SimulationManagerCfg
from embodichain.lab.sim.cfg import RenderCfg
from embodichain.lab.gym.envs.managers.cfg import EventCfg


Expand Down Expand Up @@ -113,7 +114,7 @@ def train_from_config(config_path: str, distributed: bool | None = None):
save_freq = int(trainer_cfg.get("save_freq", 50000))
num_eval_episodes = int(trainer_cfg.get("num_eval_episodes", 5))
headless = bool(trainer_cfg.get("headless", True))
enable_rt = bool(trainer_cfg.get("enable_rt", False))
renderer = trainer_cfg.get("renderer", "legacy")
gpu_id = int(trainer_cfg.get("gpu_id", 0))
num_envs = trainer_cfg.get("num_envs", None)
wandb_project_name = trainer_cfg.get("wandb_project_name", "embodichain-generic")
Expand Down Expand Up @@ -205,13 +206,12 @@ def train_from_config(config_path: str, distributed: bool | None = None):
else:
gym_env_cfg.sim_cfg.sim_device = torch.device("cpu")
gym_env_cfg.sim_cfg.headless = headless
gym_env_cfg.sim_cfg.enable_rt = enable_rt
gym_env_cfg.sim_cfg.gpu_id = local_rank if distributed else gpu_id
gym_env_cfg.sim_cfg.render_cfg = RenderCfg(renderer=renderer)
gym_env_cfg.sim_cfg.gpu_id = gpu_id
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When distributed=True, the process GPU is set via local_rank, but gym_env_cfg.sim_cfg.gpu_id is then overwritten with the config-file gpu_id (not local_rank). This can desync the engine GPU selection from the actual process device. Keep gpu_id=local_rank in distributed mode (or at least don’t override the earlier gpu_index).

Suggested change
gym_env_cfg.sim_cfg.gpu_id = gpu_id
if device.type != "cuda" and hasattr(gym_env_cfg.sim_cfg, "gpu_id"):
gym_env_cfg.sim_cfg.gpu_id = gpu_id

Copilot uses AI. Check for mistakes.

if rank == 0:
logger.log_info(
f"Loaded gym_config from {gym_config_path} (env_id={gym_config_data['id']}, num_envs={gym_env_cfg.num_envs}, headless={gym_env_cfg.sim_cfg.headless}, enable_rt={gym_env_cfg.sim_cfg.enable_rt}, sim_device={gym_env_cfg.sim_cfg.sim_device})"
)
logger.log_info(
f"Loaded gym_config from {gym_config_path} (env_id={gym_config_data['id']}, num_envs={gym_env_cfg.num_envs}, headless={gym_env_cfg.sim_cfg.headless}, renderer={gym_env_cfg.sim_cfg.render_cfg.renderer}, sim_device={gym_env_cfg.sim_cfg.sim_device})"
)

env = build_env(gym_config_data["id"], base_env_cfg=gym_env_cfg)
sample_obs, _ = env.reset()
Expand Down
1 change: 0 additions & 1 deletion embodichain/data/assets/eef_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
EMBODICHAIN_DEFAULT_DATA_ROOT,
)


eef_assets = "eef_assets"


Expand Down
1 change: 0 additions & 1 deletion embodichain/data/assets/materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
EMBODICHAIN_DEFAULT_DATA_ROOT,
)


material_assets = "materials"


Expand Down
1 change: 0 additions & 1 deletion embodichain/data/assets/obj_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
EMBODICHAIN_DEFAULT_DATA_ROOT,
)


obj_assets = "obj_assets"


Expand Down
1 change: 0 additions & 1 deletion embodichain/data/assets/robot_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
EMBODICHAIN_DEFAULT_DATA_ROOT,
)


robot_assets = "robot_assets"


Expand Down
Loading
Loading