in habitat/datasets/rearrange/rearrange_generator.py [0:0]
def get_config_defaults() -> CN:
"""
Populates and resturns a default config for a RearrangeEpisode.
"""
_C = CN()
# ----- import/initialization parameters ------
# the scene dataset from which scenes and objects are sampled
_C.dataset_path = "data/replica_cad/replicaCAD.scene_dataset_config.json"
# any additional object assets to load before defining object sets
_C.additional_object_paths = ["data/objects/ycb/"]
# ----- resource set definitions ------
# Define the sets of scenes, objects, and receptacles which can be sampled from.
# The SceneDataset will be searched for resources of each type with handles containing ANY "included" substrings and NO "excluded" substrings.
# Define sets of scene instance handles which can be sampled from for initialization:
_C.scene_sets = [
{
"name": "any",
"included_substrings": [""],
"excluded_substrings": [],
# NOTE: The "comment" key is intended for notes and descriptions and not consumed by the generator.
"comment": "The empty substring acts like a wildcard, selecting all scenes.",
},
]
# Define the sets of object handles which can be sampled from for placement and target sampling:
# NOTE: Each set must have a unique name.
_C.object_sets = [
{
"name": "any",
"included_substrings": [""],
"excluded_substrings": [],
# NOTE: The "comment" key is intended for notes and descriptions and not consumed by the generator.
"comment": "The empty substring acts like a wildcard, selecting all objects.",
},
]
# Define the sets of receptacles which can be sampled from for placing objects and targets:
# The SceneDataset will be searched for objects containing receptacle metadata.
# Receptacle name substrings are used to further constrain sets.
# NOTE: Each set must have a unique name.
_C.receptacle_sets = [
{
"name": "any",
"included_object_substrings": [""],
"excluded_object_substrings": [],
"included_receptacle_substrings": [""],
"excluded_receptacle_substrings": [],
# NOTE: The "comment" key is intended for notes and descriptions and not consumed by the generator.
"comment": "The empty substrings act like wildcards, selecting all receptacles for all objects.",
},
]
# ----- sampler definitions ------
# Define the scene sampling configuration
# NOTE: There must be exactly one scene sampler!
# "type": str ("single" or "subset")
# "params": {
# "scene_sets": [str] (if type "subset")
# "scene": str (if type "single")
# },
# NOTE: "single" scene sampler asserts that only a single scene contains the "scene" name substring
# NOTE: "subset" scene sampler allows sampling from multiple scene sets by name
# TODO: This default is a bit ugly, but we must use ConfigNodes and define all options to directly nest dicts with yacs|yaml...
_C.scene_sampler = CN()
_C.scene_sampler.type = "single"
_C.scene_sampler.params = CN()
_C.scene_sampler.params.scene = "v3_sc1_staging_00"
_C.scene_sampler.params.scene_sets = []
_C.scene_sampler.comment = ""
# Define the object sampling configuration
_C.object_samplers = [
# {"name":str, "type:str", "params":{})
# - uniform sampler params: {"object_sets":[str], "receptacle_sets":[str], "num_samples":[min, max], "orientation_sampling":str)
# NOTE: "orientation_sampling" options: "none", "up", "all"
# TODO: convert some special examples to yaml:
# (
# "fridge_middle",
# "uniform",
# (["any"], ["fridge_middle"], 1, 30, "up"),
# ),
# Composite object sampling (e.g. apple in bowl)
# - parameterized by object and receptacle sets, but inclusive of listed samplers BEFORE the composite sampler
# Example: sample a basket placement on a table and then place apples in the basket
# ("basket_sampling", "uniform", (["basket"], ["table"], 1, 1, "up")),
# (
# "in_basket_sampling",
# "uniform",
# (["apple"], ["basket"], 1, 2, "any"),
# ),
# {
# "name": "any_one",
# "type": "uniform",
# "params": {
# "object_sets": ["any"],
# "receptacle_sets": ["any"],
# "num_samples": [1, 1],
# "orientation_sampling": "up",
# },
# "comment": "Sample any one object from any receptacle.",
# }
]
# Define the desired object target sampling (i.e., where should an existing object be moved to)
_C.object_target_samplers = [
# {"name":str, "type:str", "params":{})
# - uniform target sampler params:
# {"object_samplers":[str], "receptacle_sets":[str], "num_samples":[min, max], "orientation_sampling":str)
# NOTE: random instances are chosen from the specified, previously excecuted object sampler up to the maximum number specified in params.
# NOTE: previous samplers referenced must have: combined minimum samples >= minimum requested targets
# {
# "name": "any_one_target",
# "type": "uniform",
# "params": {
# "object_samplers": ["any_one"],
# "receptacle_sets": ["any"],
# "num_samples": [1, 1],
# "orientation_sampling": "up",
# },
# "comment": "Sample a target for the object instanced by the 'any_one' object sampler from any receptacle.",
# }
]
# define ArticulatedObject(AO) joint state sampling (when a scene is initialized, all samplers are run for all matching AOs)
_C.ao_state_samplers = [
# TODO: the cupboard asset needs to be modified to remove self-collisions or have collision geometry not intersecting the wall.
# TODO: does not support spherical joints (3 dof joints)
# - uniform continuous range for a single joint. params: ("ao_handle", "link name", min, max)
# Example:
# {"name": "open_fridge_top_door",
# "type": "uniform",
# "params": ["fridge", "top_door", 1.5, 1.5]}
# - "composite" type sampler (rejection sampling of composite configuration)
# params: [{"ao_handle":str, "joint_states":[[link name, min max], ]}, ]
]
# ----- marker definitions ------
# A marker defines a point in the local space of a rigid object or articulated link which can be registered to instances in a scene and tracked
# Format for each marker is a dict containing:
# "name": str
# "type": str ("articulated_object" or "rigid_object")
# "params": {
# "object": str
# "link": str (if "articulated_object")
# "offset": vec3 []
# }
_C.markers = []
return _C.clone()