Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates EmbodiChain’s simulation/rendering integration to align with DexSim v0.4.0 by replacing the previous enable_rt-style flags with a structured rendering configuration (RenderCfg) and propagating that change through tests, examples, CLI helpers, configs, and docs.
Changes:
- Introduce
RenderCfgand migrateSimulationManagerCfgrendering settings torender_cfg. - Update scripts/examples/tests to use
--rendererand/orRenderCfg(renderer=...)instead of--enable_rt. - Apply broad formatting/whitespace cleanup across multiple modules and docs.
Reviewed changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated 33 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sim/sensors/test_stereo.py | Migrate stereo camera tests to RenderCfg/renderer-based configuration |
| tests/sim/sensors/test_contact.py | Migrate contact sensor tests to RenderCfg/renderer-based configuration |
| tests/sim/sensors/test_camera.py | Migrate camera tests to RenderCfg/renderer-based configuration |
| tests/sim/objects/test_usd.py | Update USD object tests to use render_cfg |
| tests/sim/objects/test_soft_object.py | Update soft object tests to use render_cfg |
| tests/sim/objects/test_robot.py | Whitespace cleanup |
| tests/gym/envs/test_embodied_env.py | Update env tests to use render_cfg and renderer arg |
| tests/gym/envs/managers/test_dataset_functors.py | Whitespace cleanup |
| tests/common.py | Whitespace cleanup |
| tests/agents/test_shared_rollout.py | Update sim config to use render_cfg |
| scripts/tutorials/sim/import_usd.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/gizmo_robot.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/export_usd.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/create_softbody.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/create_sensor.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/create_scene.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/create_robot.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/sim/create_rigid_object_group.py | Update tutorial script to new env launcher args + RenderCfg |
| scripts/tutorials/gym/random_reach.py | Replace ad-hoc CLI args with shared env launcher args |
| scripts/tutorials/gym/modular_env.py | Update modular env example to pass renderer/device/headless/num_envs |
| examples/sim/utility/workspace_analyzer/analyze_plane_workspace.py | Whitespace cleanup |
| examples/sim/sensors/create_contact_sensor.py | Update example to use env launcher args + RenderCfg |
| examples/sim/sensors/batch_camera.py | Update example to use env launcher args + RenderCfg |
| examples/sim/scene/scene_demo.py | Update scene demo CLI and rendering config to renderer-based setup |
| examples/sim/gizmo/gizmo_w1.py | Update gizmo example CLI and rendering config |
| examples/sim/gizmo/gizmo_scene.py | Update gizmo example CLI and rendering config |
| examples/sim/gizmo/gizmo_robot.py | Update gizmo example CLI and rendering config |
| examples/sim/gizmo/gizmo_object.py | Update gizmo example CLI and rendering config |
| examples/sim/gizmo/gizmo_camera.py | Update gizmo example CLI and rendering config |
| examples/sim/demo/scoop_ice.py | Update demo to use env launcher args + renderer configuration |
| examples/sim/demo/press_softbody.py | Update demo to use env launcher args + renderer configuration |
| examples/sim/demo/grasp_cup_to_caffe.py | Update demo to use env launcher args + renderer configuration |
| examples/agents/datasets/online_dataset_demo.py | Adjust demo engine config keys for renderer-based setup |
| embodichain/utils/warp/kinematics/opw_solver.py | Whitespace cleanup |
| embodichain/utils/configclass.py | Whitespace cleanup |
| embodichain/utils/init.py | Whitespace cleanup |
| embodichain/toolkits/urdf_assembly/component.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/voxel_visualizer.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/sphere_visualizer.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/base_visualizer.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/samplers/base_sampler.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/constraints/workspace_constraint.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/constraints/base_constraint.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/configs/init.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/caches/cache_manager.py | Whitespace cleanup |
| embodichain/lab/sim/utility/workspace_analyzer/caches/base_cache.py | Whitespace cleanup |
| embodichain/lab/sim/types.py | Whitespace cleanup |
| embodichain/lab/sim/solvers/pinocchio_solver.py | Whitespace cleanup |
| embodichain/lab/sim/solvers/opw_solver.py | Whitespace cleanup |
| embodichain/lab/sim/solvers/differential_solver.py | Whitespace cleanup |
| embodichain/lab/sim/sim_manager.py | Replace old RT flags with render_cfg, update renderer wiring and behavior |
| embodichain/lab/sim/robots/dexforce_w1/utils.py | Whitespace cleanup |
| embodichain/lab/sim/objects/gizmo.py | Whitespace cleanup |
| embodichain/lab/sim/cfg.py | Add RenderCfg configclass and DexSim renderer flag mapping |
| embodichain/lab/sim/atom_actions.py | Whitespace cleanup |
| embodichain/lab/scripts/run_agent.py | Whitespace cleanup |
| embodichain/lab/gym/utils/gym_utils.py | Update shared CLI args + config merging to use renderer/RenderCfg |
| embodichain/lab/gym/envs/tasks/tableware/pour_water/action_bank.py | Whitespace cleanup |
| embodichain/lab/gym/envs/managers/randomization/spatial.py | Whitespace cleanup |
| embodichain/lab/gym/envs/managers/randomization/physics.py | Whitespace cleanup |
| embodichain/lab/gym/envs/embodied_env.py | Whitespace cleanup |
| embodichain/lab/gym/envs/action_bank/utils.py | Whitespace cleanup |
| embodichain/data/assets/scene_assets.py | Whitespace cleanup |
| embodichain/data/assets/robot_assets.py | Whitespace cleanup |
| embodichain/data/assets/obj_assets.py | Whitespace cleanup |
| embodichain/data/assets/materials.py | Whitespace cleanup |
| embodichain/data/assets/eef_assets.py | Whitespace cleanup |
| embodichain/agents/rl/train.py | Switch trainer config handling from enable_rt to renderer/RenderCfg |
| embodichain/agents/rl/models/mlp.py | Whitespace cleanup |
| embodichain/agents/engine/data.py | Switch engine sim config from enable_rt to renderer/RenderCfg |
| embodichain/agents/datasets/sampler.py | Whitespace cleanup |
| embodichain/agents/datasets/online_data.py | Whitespace cleanup |
| docs/sync_readme.py | Formatting tweak |
| docs/source/tutorial/sensor.rst | Update tutorial CLI docs from --enable_rt to --renderer |
| docs/source/tutorial/robot.rst | Update tutorial CLI docs from --enable_rt to --renderer |
| docs/source/tutorial/gizmo.rst | Update tutorial CLI docs from --enable_rt to --renderer |
| docs/source/overview/sim/sim_manager.md | Update sim manager docs to reflect renderer configuration changes |
| configs/agents/rl/push_cube/train_config.json | Replace enable_rt with renderer and reformat JSON |
| configs/agents/rl/basic/cart_pole/train_config_grpo.json | Replace enable_rt with renderer and reformat JSON |
| configs/agents/rl/basic/cart_pole/train_config.json | Replace enable_rt with renderer and reformat JSON |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| class TestCameraRaster(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| else: | ||
| logger.log_error( | ||
| f"Invalid renderer type '{self.renderer}' specified. Must be one of 'legacy', 'hybrid', or 'fast-rt'." | ||
| ) |
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| test = CameraTest() | ||
| test.setup_simulation("cpu", enable_rt=False) | ||
| test.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) |
| gym_config["headless"] = True | ||
| gym_config["enable_rt"] = True | ||
| gym_config.get("renderer", "legacy") = True | ||
| gym_config["gpu_id"] = 0 |
There was a problem hiding this comment.
Pull request overview
This PR adapts the simulation stack and surrounding tooling to DexSim v0.4.0 by replacing the legacy enable_rt flag with a structured rendering configuration (RenderCfg) and a --renderer CLI option across tests, examples, and training/engine code.
Changes:
- Introduce
RenderCfgand migrateSimulationManagerCfgfromenable_rttorender_cfg. - Update CLI utilities and many scripts/examples to use
--renderer(legacy/hybrid/fast-rt). - Refresh tests/configs/docs to reflect the new rendering configuration.
Reviewed changes
Copilot reviewed 81 out of 81 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sim/sensors/test_stereo.py | Migrate stereo sensor tests to new rendering config (currently has call-site issues). |
| tests/sim/sensors/test_contact.py | Migrate contact sensor tests to new rendering config (currently has call-site issues). |
| tests/sim/sensors/test_camera.py | Migrate camera sensor tests to new rendering config (currently has call-site issues). |
| tests/sim/objects/test_usd.py | Update SimulationManagerCfg construction for new renderer config. |
| tests/sim/objects/test_soft_object.py | Update SimulationManagerCfg construction for new renderer config. |
| tests/sim/objects/test_robot.py | Whitespace cleanup. |
| tests/gym/envs/test_embodied_env.py | Update env test sim config for new renderer config (currently has call-site issues). |
| tests/gym/envs/managers/test_dataset_functors.py | Whitespace cleanup. |
| tests/common.py | Whitespace cleanup. |
| tests/agents/test_shared_rollout.py | Update env sim config to use render_cfg in rollout test. |
| scripts/tutorials/sim/import_usd.py | Switch to shared CLI args + renderer config (currently hard-codes values). |
| scripts/tutorials/sim/gizmo_robot.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/sim/export_usd.py | Switch to shared CLI args + renderer gating for lighting. |
| scripts/tutorials/sim/create_softbody.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/sim/create_sensor.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/sim/create_scene.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/sim/create_robot.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/sim/create_rigid_object_group.py | Switch to shared CLI args + RenderCfg(renderer=args.renderer). |
| scripts/tutorials/gym/random_reach.py | Use shared CLI args for env launching. |
| scripts/tutorials/gym/modular_env.py | Add renderer option and build sim config from shared CLI args. |
| examples/sim/utility/workspace_analyzer/analyze_plane_workspace.py | Whitespace cleanup. |
| examples/sim/sensors/create_contact_sensor.py | Switch to shared CLI args + renderer config. |
| examples/sim/sensors/batch_camera.py | Switch to shared CLI args + renderer config. |
| examples/sim/scene/scene_demo.py | Switch to shared CLI args + renderer config. |
| examples/sim/gizmo/gizmo_w1.py | Switch to shared CLI args + renderer config. |
| examples/sim/gizmo/gizmo_scene.py | Switch to shared CLI args + renderer config. |
| examples/sim/gizmo/gizmo_robot.py | Switch to shared CLI args + renderer config. |
| examples/sim/gizmo/gizmo_object.py | Switch to shared CLI args + renderer config. |
| examples/sim/gizmo/gizmo_camera.py | Switch to shared CLI args + renderer config. |
| examples/sim/demo/scoop_ice.py | Add shared CLI args and pass renderer into sim initialization. |
| examples/sim/demo/press_softbody.py | Switch to shared CLI args + renderer config. |
| examples/sim/demo/grasp_cup_to_caffe.py | Switch to shared CLI args + renderer config + lighting gate. |
| examples/agents/datasets/online_dataset_demo.py | Update gym config handling for renderer (currently contains invalid syntax). |
| embodichain/utils/warp/kinematics/opw_solver.py | Whitespace cleanup. |
| embodichain/utils/configclass.py | Whitespace cleanup. |
| embodichain/utils/init.py | Whitespace cleanup. |
| embodichain/toolkits/urdf_assembly/component.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/voxel_visualizer.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/sphere_visualizer.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/visualizers/base_visualizer.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/samplers/base_sampler.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/constraints/workspace_constraint.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/constraints/base_constraint.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/configs/init.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/caches/cache_manager.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/workspace_analyzer/caches/base_cache.py | Whitespace cleanup. |
| embodichain/lab/sim/utility/sim_utils.py | Extend RT detection + (currently) breaks SDF path due to missing import. |
| embodichain/lab/sim/types.py | Whitespace cleanup. |
| embodichain/lab/sim/solvers/pinocchio_solver.py | Whitespace cleanup. |
| embodichain/lab/sim/solvers/opw_solver.py | Whitespace cleanup. |
| embodichain/lab/sim/solvers/differential_solver.py | Whitespace cleanup. |
| embodichain/lab/sim/sim_manager.py | Replace enable_rt with render_cfg and update renderer/RT logic. |
| embodichain/lab/sim/robots/dexforce_w1/utils.py | Whitespace cleanup. |
| embodichain/lab/sim/objects/gizmo.py | Whitespace cleanup. |
| embodichain/lab/sim/cfg.py | Add RenderCfg and renderer mapping into DexSim flags. |
| embodichain/lab/sim/atom_actions.py | Whitespace cleanup. |
| embodichain/lab/scripts/run_agent.py | Whitespace cleanup. |
| embodichain/lab/gym/utils/gym_utils.py | Add --renderer, merge into config, and build sim cfg with RenderCfg. |
| embodichain/lab/gym/envs/tasks/tableware/pour_water/action_bank.py | Whitespace cleanup. |
| embodichain/lab/gym/envs/managers/randomization/spatial.py | Whitespace cleanup. |
| embodichain/lab/gym/envs/managers/randomization/physics.py | Whitespace cleanup. |
| embodichain/lab/gym/envs/embodied_env.py | Whitespace cleanup. |
| embodichain/lab/gym/envs/action_bank/utils.py | Whitespace cleanup. |
| embodichain/data/assets/scene_assets.py | Whitespace cleanup. |
| embodichain/data/assets/robot_assets.py | Whitespace cleanup. |
| embodichain/data/assets/obj_assets.py | Whitespace cleanup. |
| embodichain/data/assets/materials.py | Whitespace cleanup. |
| embodichain/data/assets/eef_assets.py | Whitespace cleanup. |
| embodichain/agents/rl/train.py | Replace trainer enable_rt with renderer and wire into RenderCfg. |
| embodichain/agents/rl/models/mlp.py | Whitespace cleanup. |
| embodichain/agents/engine/data.py | Replace engine sim config enable_rt with RenderCfg(renderer=...). |
| embodichain/agents/datasets/sampler.py | Whitespace cleanup. |
| embodichain/agents/datasets/online_data.py | Whitespace cleanup. |
| docs/sync_readme.py | Formatting tweak. |
| docs/source/tutorial/sensor.rst | Update CLI docs from --enable_rt to --renderer (needs example fix). |
| docs/source/tutorial/robot.rst | Update CLI docs from --enable_rt to --renderer (needs example fix). |
| docs/source/tutorial/gizmo.rst | Update CLI docs from --enable_rt to --renderer (needs wording/example fix). |
| docs/source/overview/sim/sim_manager.md | Update config docs for renderer (currently incorrect type/fields). |
| configs/agents/rl/push_cube/train_config.json | Replace enable_rt with renderer. |
| configs/agents/rl/basic/cart_pole/train_config.json | Replace enable_rt with renderer. |
| configs/agents/rl/basic/cart_pole/train_config_grpo.json | Replace enable_rt with renderer and formatting changes. |
Comments suppressed due to low confidence (3)
embodichain/lab/gym/utils/gym_utils.py:862
build_env_cfg_from_argsimportsRenderCfgfromembodichain.lab.sim, but the packageembodichain.lab.simdoesn't exportRenderCfg(onlySimulationManager*viasim_manager.__all__). This will raiseImportError. Import it fromembodichain.lab.sim.cfgor exportRenderCfginembodichain/lab/sim/__init__.py.
from embodichain.utils.utility import load_json
from embodichain.lab.gym.envs import EmbodiedEnvCfg
from embodichain.lab.sim import RenderCfg, SimulationManagerCfg
gym_config = load_json(args.gym_config)
gym_config = merge_args_with_gym_config(args, gym_config)
cfg: EmbodiedEnvCfg = config_to_cfg(
embodichain/lab/gym/utils/gym_utils.py:801
--gym_configwas changed torequired=False, butbuild_env_cfg_from_argsunconditionally callsload_json(args.gym_config). This makesrun_env.py/run_agent.pyfail later with a less clear error if the flag is omitted. Either keep it required for CLIs that need it, or add an explicit check with a helpful error message whenargs.gym_configis empty.
parser.add_argument(
"--gym_config",
type=str,
help="Path to gym config file.",
default="",
required=False,
)
parser.add_argument(
"--action_config", type=str, help="Path to action config file.", default=None
)
parser.add_argument(
docs/source/overview/sim/sim_manager.md:40
- The
SimulationManagerCfgtable documentsrendereras aboolwith defaultFalse, but the code now usesrender_cfg: RenderCfg(and CLI uses a string backend name). Please update the parameter name/type/default and describe the newRenderCfgfields (renderer/enable_denoiser/spp).
| `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). |
| `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. |
| `gpu_id` | `int` | `0` | The gpu index that the simulation engine will be used. Affects gpu physics device. |
| `thread_mode` | `ThreadMode` | `RENDER_SHARE_ENGINE` | The threading mode for the simulation engine. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| class TestCameraRaster(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) |
There was a problem hiding this comment.
setup_simulation now takes renderer (string) but the tests call it with a render_cfg= keyword argument, which will raise TypeError: setup_simulation() got an unexpected keyword argument 'render_cfg'. Update call sites to pass renderer="legacy"/"fast-rt"/... (or change setup_simulation to accept render_cfg).
| class TestCameraRaster(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestCameraRaster(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestCameraFastRT(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestCameraFastRT(CameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) |
There was a problem hiding this comment.
There are two classes named TestCameraRaster (and two named TestCameraFastRT) in the same module; the latter definition overwrites the former, so one set of tests will never run. Rename them to distinct CPU/CUDA variants (e.g., TestCameraRasterCPU/TestCameraRasterCUDA).
| class TestStereoCameraRaster(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestStereoCameraRaster(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestStereoCameraFastRT(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) |
There was a problem hiding this comment.
setup_simulation takes renderer (string), but the derived test classes call it with render_cfg=..., which will fail with an unexpected keyword argument. Pass renderer="legacy" / renderer="fast-rt" instead (or update the helper signature).
| class TestStereoCameraRaster(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestStereoCameraRaster(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestStereoCameraFastRT(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestStereoCameraFastRT(StereoCameraTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) |
There was a problem hiding this comment.
The module defines TestStereoCameraRaster twice and TestStereoCameraFastRT twice; later definitions overwrite earlier ones, so tests are silently dropped. Use distinct class names for CPU vs CUDA variants.
| class TestContactRaster(ContactTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestContactRasterCuda(ContactTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=False) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if False else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestContactFastRT(ContactTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cpu", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cpu", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) | ||
|
|
||
|
|
||
| class TestContactFastRTCuda(ContactTest): | ||
| def setup_method(self): | ||
| self.setup_simulation("cuda", enable_rt=True) | ||
| self.setup_simulation( | ||
| "cuda", render_cfg=RenderCfg(renderer="fast-rt" if True else "legacy") | ||
| ) |
There was a problem hiding this comment.
setup_simulation signature was changed to accept renderer, but all setup methods call it with render_cfg=... which will raise TypeError. Adjust call sites to pass renderer="legacy"/"fast-rt" (or accept render_cfg in the helper).
| def add_env_launcher_args_to_parser(parser: argparse.ArgumentParser) -> None: | ||
| """Add common environment launcher arguments to an existing argparse parser. | ||
|
|
||
| This function adds the following arguments to the provided parser: | ||
| --num_envs: Number of environments to run in parallel (default: 1) | ||
| --device: Device to run the environment on (default: 'cpu') | ||
| --headless: Whether to perform the simulation in headless mode (default: False) | ||
| --enable_rt: Whether to use RTX rendering backend for the simulation (default: False) | ||
| --renderer: Renderer backend to use for the simulation. Options are 'legacy', 'hybrid', and 'fast-rt'. (default: 'legacy') | ||
| --gpu_id: The GPU ID to use for the simulation (default: 0) | ||
| --gym_config: Path to gym config file (default: '') | ||
| --action_config: Path to action config file (default: None) | ||
| --preview: Whether to preview the environment after launching (default: False) | ||
| --filter_visual_rand: Whether to filter out visual randomization (default: False) | ||
| --filter_dataset_saving: Whether to filter out dataset saving (default: False) | ||
|
|
||
| Note: | ||
| 1. In preview mode, the environment will be launched and keep running in a loop for user interaction. | ||
|
|
||
| Args: | ||
| parser (argparse.ArgumentParser): The parser to which arguments will be added. | ||
| """ | ||
| parser.add_argument( | ||
| "--num_envs", | ||
| help="The number of environments to run in parallel.", | ||
| default=1, | ||
| type=int, | ||
| ) | ||
| parser.add_argument( | ||
| "--device", | ||
| type=str, | ||
| default="cpu", | ||
| help="Device to run the environment on, e.g., 'cpu' or 'cuda'.", | ||
| ) | ||
| parser.add_argument( | ||
| "--headless", | ||
| help="Whether to perform the simulation in headless mode.", | ||
| default=False, | ||
| action="store_true", | ||
| ) | ||
| parser.add_argument( | ||
| "--renderer", | ||
| type=str, | ||
| choices=["legacy", "hybrid", "fast-rt"], | ||
| default="hybrid", | ||
| help="Renderer backend to use for the simulation.", | ||
| ) |
There was a problem hiding this comment.
add_env_launcher_args_to_parser docstring claims --renderer defaults to 'legacy', but the actual argparse default is 'hybrid'. Please align the docstring with the code (and update any other docs that mention the default).
| @@ -60,7 +53,9 @@ def main(): | |||
| headless=True, | |||
| physics_dt=1.0 / 100.0, # Physics timestep (100 Hz) | |||
| sim_device=args.device, | |||
| enable_rt=True, # Enable ray tracing for better visuals | |||
| render_cfg=RenderCfg( | |||
| renderer="fast-rt" if True else "legacy" | |||
| ), # Enable ray tracing for better visuals | |||
| num_envs=1, | |||
| arena_space=3.0, | |||
There was a problem hiding this comment.
The script now parses common launcher args, but the simulation config still hard-codes headless=True (ignoring --headless) and hard-codes the renderer to "fast-rt" via an always-true conditional. Use headless=args.headless and RenderCfg(renderer=args.renderer) so CLI flags actually take effect.
|
|
||
| # Enable ray tracing rendering | ||
| python scripts/tutorials/sim/create_sensor.py --enable_rt | ||
| python scripts/tutorials/sim/create_sensor.py --renderer |
There was a problem hiding this comment.
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).
| python scripts/tutorials/sim/create_sensor.py --renderer | |
| python scripts/tutorials/sim/create_sensor.py --renderer fast-rt |
|
|
||
| # Enable ray tracing rendering | ||
| python scripts/tutorials/sim/create_robot.py --enable_rt | ||
| python scripts/tutorials/sim/create_robot.py --renderer |
There was a problem hiding this comment.
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).
| python scripts/tutorials/sim/create_robot.py --renderer | |
| python scripts/tutorials/sim/create_robot.py --renderer hybrid |
| - ``--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 |
There was a problem hiding this comment.
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).
Description
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
black .command to format the code base.