Implementation:Haosulab ManiSkill ReplicaCADSceneBuilder
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete tool for building scenes from the ReplicaCAD dataset in ManiSkill, handling background stages, static and dynamic objects, articulated objects, lighting, and collision configuration for the Fetch robot.
Description
ReplicaCADSceneBuilder is the base scene builder for the ReplicaCAD dataset (https://aihabitat.org/datasets/replica_cad/). It reads JSON scene configuration files to construct complete indoor environments. The builder loads the scene background (stage) as a static actor, then iterates over object instances to create either dynamic (movable) or static actors. Articulated objects (such as kitchen cabinets with doors) are loaded from URDF files.
Key implementation details:
- All ReplicaCAD assets are rotated 90 degrees via a quaternion transform because ReplicaCAD uses a different coordinate convention than SAPIEN/ManiSkill.
- Collision groups are configured to prevent the Fetch robot's wheels and base from colliding with the scene background and certain ground-level objects (mats, rugs, carpets).
- The builder supports ray-traced lighting with an HDR environment map or standard ambient/point lighting.
- Navigable positions are cached from precomputed mesh files for path planning.
- The class is registered as a scene builder via the
@register_scene_builder("ReplicaCAD")decorator.
Usage
Use this builder for any task that requires a ReplicaCAD indoor environment. It serves as the base class for more specific builders like ReplicaCADRearrangeSceneBuilder.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/utils/scene_builder/replicacad/scene_builder.py
Signature
@register_scene_builder("ReplicaCAD")
class ReplicaCADSceneBuilder(SceneBuilder):
robot_initial_pose = sapien.Pose(p=[-1, 0, 0.02])
builds_lighting = True
build_configs: list[str] = None
def __init__(self, env, robot_init_qpos_noise=0.02, include_staging_scenes=False): ...
def build(self, build_config_idxs: Union[int, list[int]]): ...
def initialize(self, env_idx: torch.Tensor): ...
def disable_fetch_move_collisions(self, actor: Actor, disable_base_collisions=False): ...
@property
def navigable_positions(self) -> list[trimesh.Trimesh]: ...
@cached_property
def ray_traced_lighting(self) -> bool: ...
Import
from mani_skill.utils.scene_builder.replicacad import ReplicaCADSceneBuilder
I/O Contract
| Method | Input | Output | Description |
|---|---|---|---|
__init__ |
env, robot_init_qpos_noise=0.02, include_staging_scenes=False |
Populated build_configs list |
Loads scene config JSON and caches navigable positions |
build |
build_config_idxs: Union[int, list[int]] |
Populates scene_objects, movable_objects, articulations, bg |
Builds stage, objects, articulations, lighting |
initialize |
env_idx: torch.Tensor |
None | Resets object poses, articulation qpos, and robot position |
disable_fetch_move_collisions |
actor: Actor, disable_base_collisions=False |
None | Sets collision group bits for Fetch robot avoidance |
Usage Examples
# Build a ReplicaCAD scene
scene_builder = ReplicaCADSceneBuilder(env)
scene_builder.build(build_config_idxs=[0] * env.num_envs)
scene_builder.initialize(env_idx=torch.arange(env.num_envs))
# Access navigable positions for path planning
nav_positions = scene_builder.navigable_positions