robocasa.models.objects package
Contents
robocasa.models.objects package¶
Submodules¶
robocasa.models.objects.kitchen_object_utils module¶
- class robocasa.models.objects.kitchen_object_utils.ObjCat(name, types, model_folders=None, exclude=None, graspable=False, washable=False, microwavable=False, cookable=False, freezable=False, scale=1.0, solimp=(0.998, 0.998, 0.001), solref=(0.001, 2), density=100, friction=(0.95, 0.3, 0.1), priority=None, aigen_cat=False)¶
Bases:
object
Class that encapsulates data for an object category.
- Parameters:
name (str) – name of the object category
types (tuple) or (str) – type(s)/categories the object belongs to. Examples include meat, sweets, fruit, etc.
model_folders (list) – list of folders containing the MJCF models for the object category
exclude (list) – list of model names to exclude
graspable (bool) – whether the object is graspable
washable (bool) – whether the object is washable
microwavable (bool) – whether the object is microwavable
cookable (bool) – whether the object is cookable
freezable (bool) – whether the object is freezable
scale (float) – scale of the object meshes/geoms
solimp (tuple) – solimp values for the object meshes/geoms
solref (tuple) – solref values for the object meshes/geoms
density (float) – density of the object meshes/geoms
friction (tuple) – friction values for the object meshes/geoms
priority – priority of the object
aigen_cat (bool) – True if the object is an AI-generated object otherwise its an objaverse object
- get_mjcf_kwargs()¶
returns relevant data to apply to the MJCF model for the object category
- robocasa.models.objects.kitchen_object_utils.sample_kitchen_object(groups, exclude_groups=None, graspable=None, washable=None, microwavable=None, cookable=None, freezable=None, rng=None, obj_registries=('objaverse',), split=None, max_size=(None, None, None), object_scale=None)¶
Sample a kitchen object from the specified groups and within max_size bounds.
- Parameters:
groups (list or str) – groups to sample from or the exact xml path of the object to spawn
exclude_groups (str or list) – groups to exclude
graspable (bool) – whether the sampled object must be graspable
washable (bool) – whether the sampled object must be washable
microwavable (bool) – whether the sampled object must be microwavable
cookable (bool) – whether whether the sampled object must be cookable
freezable (bool) – whether whether the sampled object must be freezable
rng (np.random.Generator) – random number object
obj_registries (tuple) – registries to sample from
split (str) – split to sample from. Split “A” specifies all but the last 3 object instances (or the first half - whichever is larger), “B” specifies the rest, and None specifies all.
max_size (tuple) – max size of the object. If the sampled object is not within bounds of max size, function will resample
object_scale (float) – scale of the object. If set will multiply the scale of the sampled object by this value
- Returns:
kwargs to apply to the MJCF model for the sampled object
- dict: info about the sampled object - the path of the mjcf, groups which the object’s category belongs to, the category of the object
the sampling split the object came from, and the groups the object was sampled from
- Return type:
dict
- robocasa.models.objects.kitchen_object_utils.sample_kitchen_object_helper(groups, exclude_groups=None, graspable=None, washable=None, microwavable=None, cookable=None, freezable=None, rng=None, obj_registries=('objaverse',), split=None, object_scale=None)¶
Helper function to sample a kitchen object.
- Parameters:
groups (list or str) – groups to sample from or the exact xml path of the object to spawn
exclude_groups (str or list) – groups to exclude
graspable (bool) – whether the sampled object must be graspable
washable (bool) – whether the sampled object must be washable
microwavable (bool) – whether the sampled object must be microwavable
cookable (bool) – whether whether the sampled object must be cookable
freezable (bool) – whether whether the sampled object must be freezable
rng (np.random.Generator) – random number object
obj_registries (tuple) – registries to sample from
split (str) – split to sample from. Split “A” specifies all but the last 3 object instances (or the first half - whichever is larger), “B” specifies the rest, and None specifies all.
object_scale (float) – scale of the object. If set will multiply the scale of the sampled object by this value
- Returns:
kwargs to apply to the MJCF model for the sampled object
- dict: info about the sampled object - the path of the mjcf, groups which the object’s category belongs to, the category of the object
the sampling split the object came from, and the groups the object was sampled from
- Return type:
dict
robocasa.models.objects.kitchen_objects module¶
- robocasa.models.objects.kitchen_objects.get_cats_by_type(types)¶
Retrieves a list of item keys from the global OBJ_CATEGORIES dictionary based on the specified types.
- Parameters:
types (list) – A list of valid types to filter items by. Only items with a matching type will be included.
- Returns:
A list of keys from OBJ_CATEGORIES where the item’s types intersect with the provided types.
- Return type:
list
robocasa.models.objects.objects module¶
- class robocasa.models.objects.objects.MJCFObject(name, mjcf_path, scale=1.0, solimp=(0.998, 0.998, 0.001), solref=(0.001, 1), density=100, friction=(0.95, 0.3, 0.1), margin=None, rgba=None, priority=None)¶
Bases:
MujocoXMLObject
Blender object with support for changing the scaling
- get_bbox_points(trans=None, rot=None)¶
Get the full 8 bounding box points of the object rot: a rotation matrix
- property horizontal_radius¶
Returns maximum distance from model root body to any radial point of the model.
Helps us put models programmatically without them flying away due to a huge initial contact force. Must be defined by subclass.
- Returns:
radius
- Return type:
float
- postprocess_model_xml(xml_str)¶
New version of postprocess model xml that only replaces robosuite file paths if necessary (otherwise there is an error with the “max” operation)