Implementation:Haosulab ManiSkill RoboCasaHandles
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete tool for creating handle fixtures (bar, boxed, and knob styles) that attach to cabinet and drawer panels in RoboCasa kitchen environments.
Description
This module defines a hierarchy of handle classes that are procedurally generated and attached to cabinet panels. Handles are composed of cylinder and box primitives arranged to form the desired handle shape.
Handle is the abstract base class extending MujocoObject. It loads a base XML template for the handle type, then procedurally adjusts component positions and sizes based on the parent panel dimensions (panel_w, panel_h). It manages texture application via SAPIEN render materials and supports both vertical (for cabinets) and horizontal (for drawers) orientations.
Handle types:
- BarHandle -- A cylindrical bar with two connector cylinders on top and bottom. The handle length auto-adjusts if the panel is too small. Components: "handle" (main bar), "handle_connector_top", "handle_connector_bottom".
- BoxedHandle -- A rectangular bar handle with box-shaped connectors. Similar auto-adjustment logic. Uses box visual/collision shapes instead of cylinders.
- KnobHandle -- A small cylindrical knob protruding from the panel surface. The simplest handle type with a single cylinder component.
Each handle subclass implements _create_handle() which computes positions and sizes for each component based on the panel dimensions and orientation, then updates the actor builder's collision and visual records accordingly.
Usage
Handles are instantiated automatically by CabinetPanel._add_handle() when building cabinets. The handle type is selected based on the handle_type parameter passed through the cabinet configuration.
Code Reference
Source Location
Signature
class Handle(MujocoObject):
def __init__(self, scene, name, xml, panel_w, panel_h,
texture="textures/metals/bright_metal.png",
orientation="vertical", length=None): ...
@abc.abstractmethod
def _get_components(self): ...
@abc.abstractmethod
def _create_handle(self): ...
def _set_texture(self): ...
class BarHandle(Handle):
def __init__(self, length=0.24, handle_pad=0.04, *args, **kwargs): ...
class BoxedHandle(Handle):
def __init__(self, length=0.24, handle_pad=0.04, *args, **kwargs): ...
class KnobHandle(Handle):
def __init__(self, handle_pad=0.07, *args, **kwargs): ...
Import
from mani_skill.utils.scene_builder.robocasa.fixtures.handles import (
Handle, BarHandle, BoxedHandle, KnobHandle
)
I/O Contract
| Parameter | Type | Description |
|---|---|---|
scene |
ManiSkillScene |
The simulation scene |
name |
str |
Unique handle name |
xml |
str |
Path to MJCF XML template for the handle type |
panel_w |
float |
Width of the parent panel |
panel_h |
float |
Height of the parent panel |
texture |
str |
Path to metal texture for the handle |
orientation |
str |
"vertical" (cabinets) or "horizontal" (drawers) |
length |
float |
Desired handle length; auto-adjusted if panel is too small |
Usage Examples
# Typically created internally by CabinetPanel._add_handle()
handle = BarHandle(
scene=scene,
name="cabinet_handle",
panel_w=0.3,
panel_h=0.5,
orientation="vertical",
length=0.24,
texture="textures/metals/bright_metal.png",
)