Implementation:Haosulab ManiSkill RoboCasaSink
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Robotics, Simulation, Scene_Building |
| Last Updated | 2026-02-15 08:00 GMT |
Overview
Concrete tool for creating sink fixtures in RoboCasa kitchen environments, supporting handle-based water flow simulation and spout orientation tracking.
Description
The Sink class extends Fixture to represent a kitchen sink with interactive handle and water simulation. It is typically embedded as an interior object within a Counter fixture.
Key features:
- Handle joint -- A rotational joint (
handle_joint) that controls the water flow. Water is considered "on" when the handle rotation is between 0.40 and pi radians. - Spout joint -- A separate rotational joint (
spout_joint) that controls the direction the spout faces: "left" (pi to 2*pi - pi/6), "right" (pi/6 to pi), or "center". - Water visualization --
update_state(env)toggles the water site's alpha (visibility) based on the handle state. Water appears at alpha 0.5 when on, 0.0 when off. - State control --
set_handle_state(env, rng, mode)programmatically sets the handle to "on", "off", or "random" states. - State retrieval --
get_handle_state(env)returns a dictionary with handle_joint angle, water_on boolean, spout_joint angle, and spout orientation string. - Lazy properties --
handle_jointandwater_siteare cached after first XML lookup.
Usage
Used in RoboCasa kitchen scenes for sink manipulation tasks. Typically placed inside a counter via the counter's interior_obj parameter.
Code Reference
Source Location
- Repository: Haosulab_ManiSkill
- File: mani_skill/utils/scene_builder/robocasa/fixtures/sink.py
Signature
class Sink(Fixture):
def __init__(self, scene: ManiSkillScene, xml="fixtures/sink.xml", name="sink",
*args, **kwargs): ...
def update_state(self, env): ...
def set_handle_state(self, env, rng, mode="on"): ...
def get_handle_state(self, env) -> dict: ...
@property
def handle_joint(self): ...
@property
def water_site(self): ...
@property
def nat_lang(self) -> str: ...
Import
from mani_skill.utils.scene_builder.robocasa.fixtures.sink import Sink
I/O Contract
| Method | Input | Output | Description |
|---|---|---|---|
set_handle_state |
env, rng, mode |
None | Sets handle to "on" (0.40-0.50), "off" (0.0), or "random" |
get_handle_state |
env |
dict |
Returns handle_joint, water_on, spout_joint, spout_ori |
update_state |
env |
None | Toggles water site visibility based on handle angle |
Return dictionary from get_handle_state:
| Key | Type | Description |
|---|---|---|
handle_joint |
float |
Current angle of the handle joint (radians) |
water_on |
bool |
True if water is flowing (handle between 0.40 and pi) |
spout_joint |
float |
Current angle of the spout joint (radians) |
spout_ori |
str |
Spout direction: "left", "right", or "center" |
Usage Examples
sink = Sink(scene=scene, name="kitchen_sink")
# Embed in a counter
counter = Counter(scene=scene, name="sink_counter", interior_obj=sink)
# Control sink state
sink.set_handle_state(env, rng, mode="on")
state = sink.get_handle_state(env)
print(state["water_on"]) # True
print(state["spout_ori"]) # "center"
Related Pages
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment