Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Haosulab ManiSkill RoboCasaMicrowave

From Leeroopedia
Knowledge Sources
Domains Robotics, Simulation, Scene_Building
Last Updated 2026-02-15 08:00 GMT

Overview

Concrete tool for creating microwave fixtures in RoboCasa kitchen environments, supporting door open/close simulation and start/stop button interaction.

Description

The Microwave class extends Fixture to represent a kitchen microwave with interactive capabilities. It tracks an internal _turned_on state and provides methods for:

  • Door state management -- set_door_state(min, max, env, rng) sets the microwave door opening between min and max percentages (0.0 to 1.0). The door uses a hinge joint (microjoint) with a range of 0 to pi/2 radians, with a negative sign convention (left door hinge).
  • State retrieval -- get_door_state(env) returns a dictionary mapping "door" to a normalized percentage of how open the door is.
  • Button interaction -- update_state(env) checks if the robot gripper is pressing the start or stop buttons. The microwave turns on only when the door is closed and the start button is pressed; opening the door or pressing stop turns it off.
  • Gripper distance check -- gripper_button_far(env, button, th) checks whether the gripper is far from a specified button ("start_button" or "stop_button").
  • Properties -- handle_name and door_name return the fully qualified names for the door handle and door body.

Usage

Used in RoboCasa kitchen scenes for microwave manipulation tasks. Typically placed on counter surfaces or in housing cabinets.

Code Reference

Source Location

Signature

class Microwave(Fixture):
    def __init__(self, xml="fixtures/microwaves/orig_microwave", name="microwave",
                 *args, **kwargs): ...
    def set_door_state(self, min, max, env, rng): ...
    def get_door_state(self, env) -> dict: ...
    def get_state(self) -> dict: ...
    def update_state(self, env): ...
    def gripper_button_far(self, env, button, th=0.15) -> bool: ...
    @property
    def handle_name(self) -> str: ...
    @property
    def door_name(self) -> str: ...
    @property
    def nat_lang(self) -> str: ...

Import

from mani_skill.utils.scene_builder.robocasa.fixtures.microwave import Microwave

I/O Contract

Method Input Output Description
set_door_state min: float, max: float, env, rng None Sets door opening between min% and max% (0.0-1.0)
get_door_state env dict {"door": float} Returns normalized door opening percentage
get_state None dict {"turned_on": bool} Returns whether the microwave is on
update_state env None Updates on/off state based on gripper button contact
gripper_button_far env, button: str, th: float bool True if gripper is farther than threshold from button

Usage Examples

microwave = Microwave(
    scene=scene,
    xml="fixtures/microwaves/orig_microwave",
    name="kitchen_microwave",
)
microwave.set_pos([0.5, 0.3, 1.2])
microwave.build(scene_idxs=[0])

# Check microwave state
state = microwave.get_state()
print(state["turned_on"])  # False

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment