Implementation:Haosulab ManiSkill RoboCasaSceneBuilder
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete tool for building complete RoboCasa kitchen scenes in ManiSkill, orchestrating fixture placement, object spawning, and scene initialization from YAML layout configurations.
Description
The RoboCasaSceneBuilder (extending SceneBuilder) is the main orchestrator for constructing RoboCasa kitchen environments. It is ported from the RoboCasa project and adapted for ManiSkill's SAPIEN-based simulation.
The builder maintains a registry of all supported fixture types in the FIXTURES dictionary, mapping string names to classes: hinge_cabinet, single_cabinet, open_cabinet, panel_cabinet, housing_cabinet, drawer, counter, stove, stovetop, oven, microwave, hood, sink, fridge, dishwasher, wall, floor, box, accessory, coffee_machine, toaster, window, framed_window, and more.
Key functionality:
- Scene loading -- Reads YAML layout files from the scene registry to determine fixture types, positions, sizes, and configurations.
- Fixture creation -- Instantiates fixture objects (cabinets, counters, sinks, stoves, etc.) with appropriate styles, textures, and handles.
- Fixture stacking -- Uses
FixtureStackto create vertical arrangements of cabinets and panels. - Group transforms -- Supports grouped fixture rotation and positioning for kitchen island and L-shaped layouts.
- Walls and floors -- Creates structural elements (walls, floors, backings) with textured surfaces.
- Windows -- Places decorative windows on walls.
- Object placement -- Uses
SequentialCompositeSamplerandUniformRandomSamplerto place kitchen objects on surfaces. - Robot initialization -- Configures robot start poses based on the kitchen layout, with per-robot front-facing size adjustments.
The builder supports parallel environments, building the same or different kitchen layouts across multiple simulation instances simultaneously.
The FIXTURES_INTERIOR dictionary identifies fixtures that are embedded inside other fixtures (e.g., sinks inside counters) and should not use the standard positioning system.
Usage
Used as the scene builder for all RoboCasa-based kitchen manipulation tasks in ManiSkill.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/utils/scene_builder/robocasa/scene_builder.py
Signature
FIXTURES = dict(
hinge_cabinet=HingeCabinet, single_cabinet=SingleCabinet,
open_cabinet=OpenCabinet, panel_cabinet=PanelCabinet,
housing_cabinet=HousingCabinet, drawer=Drawer,
counter=Counter, stove=Stove, stovetop=Stovetop, oven=Oven,
microwave=Microwave, hood=Hood, sink=Sink, fridge=Fridge,
dishwasher=Dishwasher, wall=Wall, floor=Floor, box=Box,
accessory=Accessory, coffee_machine=CoffeeMachine, toaster=Toaster,
window=Window, framed_window=FramedWindow, stool=Stool,
# ...
)
FIXTURES_INTERIOR = dict(
sink=Sink, stovetop=Stovetop, accessory=Accessory, wall_accessory=WallAccessory
)
class RoboCasaSceneBuilder(SceneBuilder):
def __init__(self, env, ...): ...
def build(self, ...): ...
def initialize(self, env_idx, ...): ...
Import
from mani_skill.utils.scene_builder.robocasa.scene_builder import RoboCasaSceneBuilder
I/O Contract
| Method | Input | Output | Description |
|---|---|---|---|
build |
Layout YAML configs, scene style | Populated scene with fixtures and structural elements | Constructs the full kitchen scene |
initialize |
env_idx |
Robot and object poses set | Initializes/resets the scene for a new episode |
Key data structures:
| Attribute | Type | Description |
|---|---|---|
FIXTURES |
dict |
Maps fixture name strings to fixture classes |
FIXTURES_INTERIOR |
dict |
Fixtures that attach to other fixtures |
ROBOT_FRONT_FACING_SIZE |
dict |
Robot-specific front-facing area sizes |
Usage Examples
# Used by RoboCasa-based environments
scene_builder = RoboCasaSceneBuilder(env)
scene_builder.build(build_config_idxs=[0] * env.num_envs)
scene_builder.initialize(env_idx=torch.arange(env.num_envs))
# Access placed fixtures
fixtures = scene_builder.scene_fixtures
counters = [f for f in fixtures.values() if isinstance(f, Counter)]