robocasa.models.fixtures package

Submodules

robocasa.models.fixtures.accessories module

class robocasa.models.fixtures.accessories.Accessory(xml, name, pos=None, *args, **kwargs)

Bases: Fixture

Base class for all accessories/Miscellaneous objects

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

  • pos (list) – position of the object

class robocasa.models.fixtures.accessories.CoffeeMachine(*args, **kwargs)

Bases: Accessory

Coffee machine object. Supports turning on coffee machine, and simulated coffee pouring

check_receptacle_placement_for_pouring(env, obj_name, xy_thresh=0.04)

check whether receptacle is placed under coffee machine for pouring

Parameters:
  • env (MujocoEnv) – The environment to check the state of the coffee machine in

  • obj_name (str) – name of the object

  • xy_thresh (float) – threshold for xy distance between object and receptacle

Returns:

True if object is placed under coffee machine, False otherwise

Return type:

bool

get_reset_regions(*args, **kwargs)

returns dictionary of reset regions, usually used when initialzing a mug under the coffee machine

get_state()

returns whether the coffee machine is turned on or off as a dictionary with the turned_on key

gripper_button_far(env, th=0.15)

check whether gripper is far from the start button

Parameters:
  • env (MujocoEnv) – The environment to check the state of the coffee machine in

  • th (float) – threshold for distance between gripper and button

Returns:

True if gripper is far from the button, False otherwise

Return type:

bool

property nat_lang
update_state(env)

Checks if the gripper is pressing the start button. If this is the first time the gripper pressed the button, the coffee machine is turned on, and the coffee liquid sites are turned on.

Parameters:

env (MujocoEnv) – The environment to check the state of the coffee machine in

class robocasa.models.fixtures.accessories.Stool(xml, name, pos=None, *args, **kwargs)

Bases: Accessory

property nat_lang
class robocasa.models.fixtures.accessories.Toaster(xml, name, pos=None, *args, **kwargs)

Bases: Accessory

property nat_lang
class robocasa.models.fixtures.accessories.WallAccessory(xml, name, pos, attach_to=None, protrusion=0.02, *args, **kwargs)

Bases: Fixture

Class for wall accessories. These are objects that are attached to walls, such as outlets, clocks, paintings, etc.

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

  • pos (list) – position of the object

  • attach_to (Wall) – The wall to attach the object to

  • protrusion (float) – How much to protrude out of the wall when placing the object

robocasa.models.fixtures.cabinet_panels module

class robocasa.models.fixtures.cabinet_panels.CabinetPanel(xml, size, name, handle_type='bar', handle_config=None, handle_hpos=None, handle_vpos=None, texture=None)

Bases: MujocoXMLObject

Base class for cabinet panels which are attached to the cabinet body.

Parameters:
  • xml (str) – Path to the xml file for the cabinet panel.

  • size (list) – Size of the cabinet panel in [w, d, h] format.

  • name (str) – Name of the cabinet panel.

  • handle_type (str) – Type of handle to attach to the cabinet panel.

  • handle_config (dict) – Configuration for the handle.

  • handle_hpos (str) – Horizontal position of the handle.

  • handle_vpos (str) – Vertical position of the handle.

  • texture (str) – Path to the texture file for the cabinet panel.

exclude_from_prefixing(inp)

Exclude all shared materials and their associated names from being prefixed.

Parameters:

inp (ET.Element or str) – Element or its attribute to check for prefixing.

Returns:

True if we should exclude the associated name(s) with @inp from being prefixed with naming_prefix

Return type:

bool

class robocasa.models.fixtures.cabinet_panels.CabinetShelf(size, texture, name, pos=None)

Bases: MujocoXMLObject

Initialize a cabinet shelf, which is a simple flat panel but rotated 90 degrees.

Parameters:
  • size (list) – Size of the cabinet shelf in [w, d, h] format.

  • texture (str) – Path to the texture file for the cabinet shelf.

  • name (str) – Name of the cabinet shelf.

  • pos (list) – Position of the cabinet shelf.

exclude_from_prefixing(inp)

Exclude all shared materials and their associated names from being prefixed.

Parameters:

inp (ET.Element or str) – Element or its attribute to check for prefixing.

Returns:

True if we should exclude the associated name(s) with @inp from being prefixed with naming_prefix

Return type:

bool

class robocasa.models.fixtures.cabinet_panels.DividedWindowCabinetPanel(name, trim_th=0.02, trim_size=0.08, *args, **kwargs)

Bases: CabinetPanel

Initialize a divided window cabinet panel, which is a panel with a windowed door, trims around, and a 2 trims running down the middle of the window (horizontally and vertically aligned).

Parameters:
  • name (str) – Name of the cabinet panel.

  • trim_th (float) – Thickness of the trim (depth).

  • trim_size (float) – Size of the trims (width/height).

class robocasa.models.fixtures.cabinet_panels.FullWindowedCabinetPanel(name, trim_th=0.02, trim_size=0.08, opacity=0.5, *args, **kwargs)

Bases: CabinetPanel

Initialize a full windowed cabinet panel, which is a panel with a windowed door and trims around. Same as the divided window panel but without the middle trims running through the window.

Parameters:
  • name (str) – Name of the cabinet panel.

  • trim_th (float) – Thickness of the trim (depth).

  • trim_size (float) – Size of the trims (width/height).

  • opacity (float) – Opacity of the window. Defaults to 0.5 to create a “frosted” effect.

class robocasa.models.fixtures.cabinet_panels.RaisedCabinetPanel(name, trim_th=0.02, trim_size=0.08, raised_gap=0.01, *args, **kwargs)

Bases: CabinetPanel

Initialize a raised cabinet panel, similar to the shaker panel, but with a raised door portion.

Parameters:
  • trim_th (float) – Thickness of the trim (depth).

  • trim_size (float) – Size of the trim (width/height).

  • raised_gap (float) – Gap between the raised portion and the sorrounding trims

class robocasa.models.fixtures.cabinet_panels.ShakerCabinetPanel(name, trim_th=0.02, trim_size=0.08, *args, **kwargs)

Bases: CabinetPanel

Initialize a shaker cabinet panel, which is a simple flat panel with a trim.

Parameters:
  • trim_th (float) – Thickness of the trim (depth).

  • trim_size (float) – Size of the trim (width/height).

class robocasa.models.fixtures.cabinet_panels.SlabCabinetPanel(*args, **kwargs)

Bases: CabinetPanel

Initialize a slab cabinet panel, which is a simple flat panel.

robocasa.models.fixtures.cabinets module

class robocasa.models.fixtures.cabinets.Cabinet(xml, name, size, thickness=0.03, door_gap=0.003, handle_type='bar', handle_config=None, panel_type='raised', panel_config=None, open_top=False, texture=None, *args, **kwargs)

Bases: ProcGenFixture

Cabinet class. Procedurally defined with primitive geoms

Parameters:
  • xml (str) – path to xml file

  • name (str) – name of the cabinet

  • size (list) – size of the cabinet [w, d, h]

  • thickness (float) – thickness of the cabinet walls

  • door_gap (float) – gap for the doors applied to height and width

  • handle_type (str) – type of handle attached to cabinet

  • handle_config (dict) – configuration for handle. contains keyword arguments for handle class

  • panel_type (str) – type of panel used for cabinet

  • panel_config (dict) – configuration for panel. contains keyword arguments for panel class

  • open_top (bool) – whether to remove top element

  • texture (str) – path to texture file

get_door_state(env)
get_reset_regions(env)

Get the reset regions for the cabinet. This is used to reset the object to a specific location. Reset region is defined as the bottom of the cabinet

property nat_lang
set_door_state(min, max, env, rng)
class robocasa.models.fixtures.cabinets.Drawer(name='drawer', handle_config=None, *args, **kwargs)

Bases: Cabinet

Creates a Drawer

Parameters:
  • name (str) – name of the cabinet

  • handle_config (dict) – configuration for handle. contains keyword arguments for handle class

get_door_state(env)
Parameters:

env (MujocoEnv) – environment

Returns:

maps door name to a percentage of how open the door is

Return type:

dict

property handle_name
property nat_lang
set_door_state(min, max, env, rng)

Sets how open the drawer is. Chooses a random amount between min and max. Min and max are percentages of how open the drawer is.

Parameters:
  • min (float) – minimum percentage of how open the drawer is

  • max (float) – maximum percentage of how open the drawer is

  • env (MujocoEnv) – environment

  • rng (np.random.Generator) – random number generator

update_state(env)

Updates the interior bounding boxes of the drawer to be matched with how open the drawer is. This is needed when determining if an object is inside the drawer or when placing an object inside an open drawer.

Parameters:

env (MujocoEnv) – environment

class robocasa.models.fixtures.cabinets.HingeCabinet(name='hinge_cab', *args, **kwargs)

Bases: Cabinet

Creates a HingeCabinet object which is a cabinet with two doors that open outwards

Parameters:

name (str) – name of the cabinet

get_door_state(env)
Parameters:

env (MujocoEnv) – environment

Returns:

maps door names to a percentage of how open they are

Return type:

dict

get_state(sim)
Parameters:

env (MujocoEnv) – environment

Returns:

maps joint names to joint values

Return type:

dict

property left_handle_name
property right_handle_name
set_door_state(min, max, env, rng)

Sets how open the doors are. Chooses a random amount between min and max. Min and max are percentages of how open the doors are

Parameters:
  • min (float) – minimum percentage of how open the door is

  • max (float) – maximum percentage of how open the door is

  • env (MujocoEnv) – environment

  • rng (np.random.Generator) – random number generator

class robocasa.models.fixtures.cabinets.HousingCabinet(interior_obj, size=None, padding=None, name='housing_cab', *args, **kwargs)

Bases: Cabinet

Creates a HousingCabinet object which is a cabinet which is hollowed out to contain another object

Parameters:
  • interior_obj (Fixture) – Fixture to be placed inside the cabinet

  • size (list) – Size of the cabinet in [x, y, z]

  • padding (list) – Thickness of the cabinet walls in [[-x, x], [-y, y], [-z, z]]. For each dimension, if size is specified,

  • versa. (padding is optional and vice)

  • name (str) – Name of the cabinet

set_pos(pos)

Sets the position of the cabinet and the interior object

Parameters:

pos (list) – position of the cabinet

class robocasa.models.fixtures.cabinets.OpenCabinet(name='shelves', num_shelves=2, *args, **kwargs)

Bases: Cabinet

Creates a OpenCabinet object which is a cabinet with open shelves

Parameters:
  • name (str) – name of the cabinet

  • num_shelves (int) – number of shelves in the cabinet

property nat_lang
class robocasa.models.fixtures.cabinets.PanelCabinet(name='panel_cab', solid_body=False, *args, **kwargs)

Bases: Cabinet

Creates a PanelCabinet object which is a cabinet with a panel door but no handle. This is mainly used in a fixture stack where there is an unopenable cabinet/drawer

Parameters:
  • name (str) – name of the cabinet

  • solid_body (bool) – whether to create a solid body for the cabinet behind the panel

get_state(sim)

get the current state of the fixture

class robocasa.models.fixtures.cabinets.SingleCabinet(name='single_cab', orientation='right', *args, **kwargs)

Bases: Cabinet

Creates a SingleCabinet object which is a cabinet with a single door that either opens left or right

Parameters:
  • orientation (str) – The direction in which the cabinet opens when facing the cabinet. “left” or “right”

  • name (str) – name of the cabinet

property door_name
get_door_state(env)
Parameters:

env (MujocoEnv) – environment

Returns:

maps door name to a percentage of how open the door is

Return type:

dict

property handle_name
set_door_state(min, max, env, rng)

Sets how open the door is. Chooses a random amount between min and max. Min and max are percentages of how open the door is

Parameters:
  • min (float) – minimum percentage of how open the door is

  • max (float) – maximum percentage of how open the door is

  • env (MujocoEnv) – environment

  • rng (np.random.Generator) – random number generator

robocasa.models.fixtures.counter module

class robocasa.models.fixtures.counter.Counter(name='counter', size=(0.72, 0.6, 0.6), overhang=0, top_texture=None, top_thickness=0.03, half_top=[False, False], base_texture=None, base_color=None, base_opening=[False, False], hollow=[False, True], interior_obj=None, obj_y_percent=0.5, obj_x_percent=0.5, *args, **kwargs)

Bases: ProcGenFixture

Initializes a counter fixture.

Parameters:
  • name (str) – name of the counter

  • size (tuple) – size of the counter (width, depth, height)

  • overhang (float) – amount which the top of the counter overhangs the base

  • top_texture (str) – path to the texture file for the top of the counter

  • top_thickness (float) – thickness of the top of the counter

  • half_top (list) – list of booleans to specify if the counter is half-sized and extends right or left

  • base_texture (str) – path to the texture file for the base of the counter

  • base_color (list) – list of 4 floats specifying the color of the base

  • base_opening (list) – list of booleans to specify if the counter has an opening in the front or back

  • hollow (list) – list of booleans to specify if the should exclude the front, back, or the whole the base. Both hollow and base_opening cannot be set at the same time if they are, base_opening takes precedence.

  • interior_obj (ProcGenFixture) – object to be placed inside the counter

  • obj_y_percent (float) – Percentage of the counter’s depth taken up by the interior object

  • obj_x_percent (float) – Percentage of the counter’s width taken up by the interior object

property depth

for getting the depth of an object as defined by its exterior sites. takes scaling into account

get_reset_regions(env, ref=None, loc='nn', top_size=(0.4, 0.4))

returns dictionary of reset regions, each region defined as offsets and size

Parameters:
  • env (Kitchen) – the kitchen environment which contains this counter

  • ref (str) – reference fixture used in determining sampling location

  • loc (str) – sampling method, one of [“nn”, “left”, “right”, “left_right”, “any”] nn: chooses the closest top geom to the reference fixture left: chooses the any top geom within 0.3 distance of the left side of the reference fixture right: chooses the any top geom within 0.3 distance of the right side of the reference fixture left_right: chooses the any top geom within 0.3 distance of the left or right side of the reference fixture any: chooses any top geom

  • top_size (tuple) – minimum size of the top region to return

Returns:

dictionary of reset regions

Return type:

dict

property height

for getting the height of an object as defined by its exterior sites. takes scaling into account

set_pos(pos)

Set position of object position is defined as center of bounding box

Parameters:

pos (list of floats) – 3D position to set object (should be 3 dims)

property width

for getting the width of an object as defined by its exterior sites. takes scaling into account

robocasa.models.fixtures.dishwasher module

class robocasa.models.fixtures.dishwasher.Dishwasher(xml='fixtures/appliances/dishwashers/pack_1/model.xml', name='dishwasher', *args, **kwargs)

Bases: Fixture

Dishwasher fixture class

property nat_lang

robocasa.models.fixtures.fixture module

class robocasa.models.fixtures.fixture.Fixture(xml, name, duplicate_collision_geoms=True, pos=None, scale=1, size=None, placement=None, rng=None)

Bases: MujocoXMLObject

Base class for fixtures in robosuite kitchen environments.

Parameters:
  • xml (str) – Path to the MJCF xml file to load the fixture from

  • name (str) – Name of the fixture

  • duplicate_collision_geoms (bool) – If set, will guarantee that each collision geom has a visual geom copy

  • pos (3-tuple) – (x, y, z) position of the fixture

  • scale (float) – 3D Scaling factor for the fixture

  • size (3-tuple) – desired (width, depth, height) of the fixture

property bottom_offset

Returns vector from model root body to model bottom. Useful for, e.g. placing models on a surface. Must be defined by subclass.

Returns:

(dx, dy, dz) offset vector

Return type:

np.array

property depth

for getting the depth of an object as defined by its exterior sites. takes scaling into account

property euler
get_bbox_points(trans=None, rot=None)

Get the full set of bounding box points of the object rot: a rotation matrix

get_ext_sites(all_points=False, relative=True)

Get the exterior bounding box points of the object

Parameters:
  • all_points (bool) – If True, will return all 8 points of the bounding box

  • relative (bool) – If True, will return the points relative to the object’s position

Returns:

4 or 8 points

Return type:

list

get_int_sites(all_points=False, relative=True)

Get the interior bounding box points of the object

Parameters:
  • all_points (bool) – If True, will return all 8 points of the bounding box

  • relative (bool) – If True, will return the points relative to the object’s position

Returns:

4 or 8 points

Return type:

list

get_reset_regions(*args, **kwargs)

returns dictionary of reset regions, each region defined as position, x_bounds, y_bounds

get_site_info(sim)

returns user defined sites (eg. the table top, door handle sites, handle sites, shelf sites, etc) requires sim as position of sites can change during simulation.

abstract get_state()

get the current state of the fixture

property height

for getting the height of an object as defined by its exterior sites. takes scaling into account

property horizontal_radius

override the default behavior of only looking at first dimension for radius

property nat_lang
property pos
property quat
sample_reset_region(*args, **kwargs)
set_bounds_sites(pos_dict)

Set the positions of the exterior and interior bounding box sites of the object

Parameters:

pos_dict (dict) – Dictionary of sites and their new positions

set_origin(origin)

Set the origin of the fixture to a specified position

Parameters:

origin (3-tuple) – new (x, y, z) position of the fixture

set_scale_from_size(size)

Set the scale of the fixture based on the desired size. If any of the dimensions are None, the scaling factor will be the same as one of the other two dimensions

Parameters:

size (3-tuple) – (width, depth, height) of the fixture

abstract update_state(env)

update internal state of fixture

property width

for getting the width of an object as defined by its exterior sites. takes scaling into account

class robocasa.models.fixtures.fixture.FixtureType(value)

Bases: IntEnum

Enum for fixture types in robosuite kitchen environments.

CABINET = 5
CABINET_TOP = 16
COFFEE_MACHINE = 8
COUNTER = 1
COUNTER_NON_CORNER = 22
DINING_COUNTER = 18
DOOR = 9
DOOR_HINGE = 10
DOOR_HINGE_DOUBLE = 12
DOOR_HINGE_SINGLE = 11
DOOR_TOP_HINGE = 13
DOOR_TOP_HINGE_DOUBLE = 15
DOOR_TOP_HINGE_SINGLE = 14
DRAWER = 6
ISLAND = 21
MICROWAVE = 2
SHELF = 7
SINK = 4
STOOL = 20
STOVE = 3
TOASTER = 17
TOP_DRAWER = 19
class robocasa.models.fixtures.fixture.ProcGenFixture(xml, name, duplicate_collision_geoms=True, pos=None, scale=1, size=None, placement=None, rng=None)

Bases: Fixture

exclude_from_prefixing(inp)

Exclude all shared materials and their associated names from being prefixed.

Parameters:

inp (ET.Element or str) – Element or its attribute to check for prefixing.

Returns:

True if we should exclude the associated name(s) with @inp from being prefixed with naming_prefix

Return type:

bool

robocasa.models.fixtures.fixture.get_texture_name_from_file(file)

Extract texture name from filename. eg: ../robosuite/models/assets/textures/flat/gray.png -> flat/gray

robocasa.models.fixtures.fixture.site_pos(site)

robocasa.models.fixtures.fixture_stack module

class robocasa.models.fixtures.fixture_stack.FixtureStack(config, scene_fixtures, scene_configs, scene_style, base_height=0.05, base_overhang=0.07, default_texture=None, rng=None)

Bases: object

Class for encapsulating a stack of stackable fixtures

Parameters:
  • config (dict) – configuration for the stack. Contains at least the following keys: - size (list): [width, depth, height] of the stack - levels (list): list of fixtures to stack on top of each other - percentages (list): list of percentages of the height of each level

  • scene_fixtures (dict) – dictionary of fixtures in the scene

  • scene_configs (dict) – dictionary of configurations for fixtures in the scene

  • scene_style (dict) – dictionary of style information for fixtures in the scene

  • base_height (float) – height of the base of the stack

  • base_overhang (float) – how much the stack should overhang the base

robocasa.models.fixtures.fixture_utils module

robocasa.models.fixtures.fixture_utils.fixture_is_type(fixture, fixture_type)

Check if a fixture is of a certain type

Parameters:
  • fixture (Fixture) – The fixture to check

  • fixture_type (FixtureType) – The type to check against

robocasa.models.fixtures.fridge module

class robocasa.models.fixtures.fridge.Fridge(xml='fixtures/appliances/fridges/pack_1/model.xml', name='fridge', *args, **kwargs)

Bases: Fixture

Fridge fixture class

property nat_lang

robocasa.models.fixtures.handles module

class robocasa.models.fixtures.handles.BarHandle(length=0.24, handle_pad=0.04, *args, **kwargs)

Bases: Handle

Creates a bar handle

Parameters:
  • length (float) – Length of the handle

  • handle_pad (float) – A minimum difference between handle length and cabinet panel height

class robocasa.models.fixtures.handles.BoxedHandle(length=0.24, handle_pad=0.04, *args, **kwargs)

Bases: Handle

Creates a boxed handle

Parameters:
  • length (float) – Length of the handle

  • handle_pad (float) – A minimum difference between handle length and cabinet panel height

class robocasa.models.fixtures.handles.Handle(name, xml, panel_w, panel_h, texture='textures/metals/bright_metal.png', orientation='vertical', length=None)

Bases: MujocoXMLObject

Base class for all handles attached to cabinet/drawer panels

Parameters:
  • name (str) – Name of the handle

  • xml (str) – Path to the xml file of the handle

  • panel_w (float) – Width of the panel to attach the handle to

  • panel_h (float) – Height of the panel to attach the handle to

  • texture (str) – Path to the texture file of the handle

  • orientation (str) – Orientation of the handle. Can be either “horizontal” (for drawers) or “vertical”

  • length (float) – Length of the handle

exclude_from_prefixing(inp)

Exclude all shared materials and their associated names from being prefixed.

Parameters:

inp (ET.Element or str) – Element or its attribute to check for prefixing.

Returns:

True if we should exclude the associated name(s) with @inp from being prefixed with naming_prefix

Return type:

bool

class robocasa.models.fixtures.handles.KnobHandle(handle_pad=0.07, *args, **kwargs)

Bases: Handle

Creates a knob handle

robocasa.models.fixtures.hood module

class robocasa.models.fixtures.hood.Hood(xml='fixtures/hoods/basic_silver.xml', name='hood', *args, **kwargs)

Bases: Fixture

Hood fixture class

property nat_lang

robocasa.models.fixtures.microwave module

class robocasa.models.fixtures.microwave.Microwave(xml='fixtures/microwaves/orig_microwave', name='microwave', *args, **kwargs)

Bases: Fixture

Microwave fixture class. Supports turning on and off the microwave, and opening and closing the door

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

property door_name
get_door_state(env)
Parameters:

env (MujocoEnv) – environment

Returns:

maps door name to a percentage of how open the door is

Return type:

dict

get_state()
Returns:

maps turned_on to whether the microwave is turned on

Return type:

dict

gripper_button_far(env, button, th=0.15)

check whether gripper is far from the start button

Parameters:
  • env (MujocoEnv) – The environment to check the state of the microwave in

  • button (str) – button to check

  • th (float) – threshold for distance between gripper and button

Returns:

True if gripper is far from the button, False otherwise

Return type:

bool

property handle_name
property nat_lang
set_door_state(min, max, env, rng)

Sets how open the door is. Chooses a random amount between min and max. Min and max are percentages of how open the door is

Parameters:
  • min (float) – minimum percentage of how open the door is

  • max (float) – maximum percentage of how open the door is

  • env (MujocoEnv) – environment

  • rng (np.random.Generator) – random number generator

update_state(env)

If the microwave is open, the state is set to off. Otherwise, if the gripper is pressing the start button, the microwave will stay/turn on. If the gripper is pressing the stop button, the microwave will stay/turn off.

Parameters:

env (MujocoEnv) – The environment to check the state of the microwave in

robocasa.models.fixtures.others module

class robocasa.models.fixtures.others.Box(pos, size, name='box', texture='textures/wood/dark_wood_parquet.png', mat_attrib={'shininess': '0.1'}, tex_attrib={'type': 'cube'}, rng=None, *args, **kwargs)

Bases: BoxObject

Initializes a box object. Mainly used for filling in gaps in the environment like in corners or beneath bottom cabinets

Parameters:
  • pos (list) – position of the object

  • size (list) – size of the object

  • name (str) – name of the object

  • texture (str) – path to texture file

  • mat_attrib (dict) – material attributes

  • tex_attrib (dict) – texture attributes

property rot

Returns the rotation of the object only on the z-axis

Returns:

rotation

Return type:

float

set_pos(pos)

Set the position of the object

Parameters:

pos (list) – position of the object

update_state(env)
class robocasa.models.fixtures.others.Floor(size, name='wall', texture='textures/bricks/red_bricks.png', mat_attrib={'reflectance': '0.1', 'shininess': '0.1', 'texrepeat': '2 2', 'texuniform': 'true'}, *args, **kwargs)

Bases: Wall

class robocasa.models.fixtures.others.Wall(name='wall', texture='textures/bricks/white_bricks.png', pos=None, quat=None, size=None, wall_side='back', mat_attrib={'reflectance': '0.1', 'shininess': '0.1', 'texrepeat': '3 3', 'texuniform': 'true'}, tex_attrib={'type': '2d'}, backing=False, backing_extended=[False, False], default_wall_th=0.02, default_backing_th=0.1, rng=None, *args, **kwargs)

Bases: BoxObject

Initializes a wall object. Used for creating walls in the environment

Parameters:
  • name (str) – name of the object

  • texture (str) – path to texture file

  • pos (list) – position of the object

  • quat (list) – quaternion of the object

  • size (list) – size of the object

  • wall_side (str) – which side the wall is on (back, front, left, right, floor)

  • mat_attrib (dict) – material attributes

  • tex_attrib (dict) – texture attributes

  • backing (bool) – whether this is a backing wall

  • backing_extended (list) – whether the backing is extended on the left and right

  • default_wall_th (float) – default thickness of the wall

  • default_backing_th (float) – default thickness of the backing

get_quat()

Returns the quaternion of the object based on the wall side

Returns:

quaternion

Return type:

list

set_pos(pos)

Set the position of the object

Parameters:

pos (list) – position of the object

update_state(env)

robocasa.models.fixtures.sink module

class robocasa.models.fixtures.sink.Sink(xml='fixtures/sink.xml', name='sink', *args, **kwargs)

Bases: Fixture

Sink fixture class. The sink has a handle_joint that can be turned on and off to simulate water flow

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

get_handle_state(env)

Gets the state of the handle_joint

Parameters:

env (MujocoEnv) – environment

Returns:

maps handle_joint to the angle of the handle_joint, water_on to whether the water is flowing, spout_joint to the angle of the spout_joint, and spout_ori to the orientation of the spout (left, right, center)

Return type:

dict

property handle_joint

Returns the joint element which represents the handle_joint of the sink

property nat_lang
set_handle_state(env, rng, mode='on')

Sets the state of the handle_joint based on the mode parameter

Parameters:
  • env (MujocoEnv) – environment

  • rng (np.random.Generator) – random number generator

  • mode (str) – “on”, “off”, or “random”

update_state(env)

Updates the water flowing of the sink based on the handle_joint position

Parameters:

env (MujocoEnv) – environment

property water_site

Returns the site element which represents the water flow of the sink

robocasa.models.fixtures.stove module

class robocasa.models.fixtures.stove.Oven(xml='fixtures/ovens/samsung', name='oven', *args, **kwargs)

Bases: Fixture

Oven fixture class

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

property nat_lang
class robocasa.models.fixtures.stove.Stove(xml='fixtures/stoves/stove_orig', name='stove', *args, **kwargs)

Bases: Fixture

Stove fixture class. The stove has knob joints that can be turned on and off to simulate burner flames

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

property burner_sites

Returns the burner sites of the stove

get_knobs_state(env)

Gets the angle of which knob joints are turned

Parameters:

env (MujocoEnv) – environment

Returns:

maps location of knob to the angle of the knob joint

Return type:

dict

get_reset_regions(env, locs=None)

Returns dictionary of reset regions, usually used when initializing a receptacle on the stove. The regions are the sites where the burner flames are located.

Parameters:
  • env (MujocoEnv) – environment

  • locs (list) – list of locations to get reset regions for. If None, uses all locations

Returns:

dictionary of reset regions

Return type:

dict

property knob_joints

Returns the knob joints of the stove

property nat_lang
set_knob_state(env, rng, knob, mode='on')

Sets the state of the knob joint based on the mode parameter

Parameters:
  • env (MujocoEnv) – environment

  • rng (np.random.RandomState) – random number generator

  • knob (str) – location of the knob

  • mode (str) – “on” or “off”

update_state(env)

Updates the burner flames of the stove based on the knob joint positions

Parameters:

env (MujocoEnv) – environment

class robocasa.models.fixtures.stove.Stovetop(xml='fixtures/stoves/stove_orig', name='stove', *args, **kwargs)

Bases: Stove

Stovetop fixture class. The stovetop has knob joints that can be turned on and off to simulate burner flames

Parameters:
  • xml (str) – path to mjcf xml file

  • name (str) – name of the object

robocasa.models.fixtures.windows module

class robocasa.models.fixtures.windows.FramedWindow(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)

Bases: Window

Window object with a frame around it

Parameters:
  • name (str) – name of the object

  • size (list) – size of the window(s) (considers multiple windows in the x-direction)

  • ofs (list) – offset of the window

  • pos (list) – position of the window

  • quat (list) – quaternion of the window

  • window_bak (str) – path to the window background texture

  • texture (str) – path to the window pane texture

  • trim_th (float) – thickness of the trim (depth/protrusion of the trim from the window pane)

  • trim_size (float) – size of the trim

  • num_windows (int) – number of windows placed side-by-side

  • frame_width (float) – width of the frame around the window

create_window()

Creates the window object with trim and glass and frame by setting the relevant sizes and positions of the geoms in the window.

set_pos(pos)

Set the position of the window

Parameters:

pos (list) – position of the window

class robocasa.models.fixtures.windows.Window(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)

Bases: CompositeBodyObject

Window object. Supports creating windows with trim and glass. Proceduraly generated object (no xml needed)

Parameters:
  • name (str) – name of the object

  • size (list) – size of the window(s) (considers multiple windows in the x-direction)

  • ofs (list) – offset of the window

  • pos (list) – position of the window

  • quat (list) – quaternion of the window

  • window_bak (str) – path to the window background texture

  • texture (str) – path to the window pane texture

  • trim_th (float) – thickness of the trim (depth/protrusion of the trim from the window pane)

  • trim_size (float) – size of the trim

  • num_windows (int) – number of windows placed side-by-side

create_window()

Creates the window object with trim and glass by setting the relevant sizes and positions of the geoms in the window. This is very similar to the create panel functions in the cabinet panel classes

property nat_lang
property rot
set_pos(pos)

Set the position of the window

Parameters:

pos (list) – position of the window

update_state(env)

Module contents