Implementation:Haosulab ManiSkill RoboCasaWindows
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete tool for creating procedurally generated window fixtures in RoboCasa kitchen environments, with support for trim, glass panes, and optional frames.
Description
This module defines window fixtures that are procedurally generated (no MJCF XML needed). Windows are composed of box primitives representing trim pieces and glass panes. The Window class supports placing multiple individual window panes side-by-side.
Classes defined:
- Window -- Base window class that creates trim (left, right, top, bottom, vertical and horizontal dividers) and a glass pane. The glass uses a background texture to simulate a view. Supports configurable number of windows placed side-by-side, trim thickness and size, and window offset. The
create_window()method programmatically computes all geometry positions and sizes, builds them using a single SAPIEN actor builder with multiple box visual/collision shapes. - FramedWindow -- Extends
Windowby adding a surrounding frame. The frame consists of four additional box pieces (top, bottom, left, right). The window size is reduced to account for the frame width.
Key implementation details:
- The glass pane is rotated 90 degrees (quaternion
[0, 0, 0.7071081, 0.7071055]) for correct texture display. - Window offsets are computed via
_get_window_offsets()usingnp.linspaceto evenly distribute multiple windows. - Materials are created as SAPIEN render materials with texture references to trim and window background images.
Usage
Used in RoboCasa kitchen scenes to add decorative windows. Typically instantiated by the scene builder based on the layout YAML configuration.
Code Reference
Source Location
Signature
class Window:
def __init__(self, scene: ManiSkillScene, name, size, ofs=None, pos=None, quat=None,
window_bak="textures/others/bk7.png", texture="textures/flat/white.png",
trim_th=0.02, trim_size=0.015, num_windows=1, rng=None): ...
def build(self, scene_idxs: list[int]): ...
def create_window(self): ...
def set_pos(self, pos): ...
def update_state(self, env): ...
@property
def nat_lang(self) -> str: ...
class FramedWindow(Window):
def __init__(self, scene: ManiSkillScene, name, size, ofs=None, pos=None, quat=None,
window_bak="textures/others/bk7.png", texture="textures/flat/white.png",
trim_th=0.02, trim_size=0.015, num_windows=1, frame_width=0.05, rng=None): ...
def create_window(self): ...
Import
from mani_skill.utils.scene_builder.robocasa.fixtures.windows import Window, FramedWindow
I/O Contract
| Parameter | Type | Description |
|---|---|---|
scene |
ManiSkillScene |
The simulation scene |
name |
str |
Unique window name |
size |
list |
Total window dimensions [width, depth, height]
|
num_windows |
int |
Number of individual window panes side-by-side |
trim_th |
float |
Trim thickness/depth (default 0.02) |
trim_size |
float |
Trim width (default 0.015) |
window_bak |
str |
Background texture for the glass pane |
frame_width |
float |
Frame width for FramedWindow (default 0.05) |
Usage Examples
# Create a framed window with 2 panes
window = FramedWindow(
scene=scene,
name="kitchen_window",
size=[1.0, 0.05, 0.8],
pos=[2.0, 3.0, 1.5],
num_windows=2,
frame_width=0.05,
)
window.build(scene_idxs=[0])