From fea8975c6ac6f13fedbf271fa6531fe064d57cf1 Mon Sep 17 00:00:00 2001 From: cremebrule <84cremebrule@gmail.com> Date: Thu, 12 Dec 2024 14:30:36 -0800 Subject: [PATCH] rename EXTERNAL_DATASET -> CUSTOM_DATASET --- docs/tutorials/custom_robot_import.md | 4 ++-- omnigibson/examples/objects/import_custom_object.py | 2 +- omnigibson/examples/robots/import_custom_robot.py | 4 ++-- omnigibson/macros.py | 4 ++-- omnigibson/objects/dataset_object.py | 8 ++++---- omnigibson/utils/asset_conversion_utils.py | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/tutorials/custom_robot_import.md b/docs/tutorials/custom_robot_import.md index bfa3a4694..c05c25aac 100644 --- a/docs/tutorials/custom_robot_import.md +++ b/docs/tutorials/custom_robot_import.md @@ -19,13 +19,13 @@ There are two ways to convert our raw robot URDF into an OmniGibson-compatible U Our custom robot importer [`import_custom_robot.py`](https://github.com/StanfordVL/OmniGibson/tree/main/omnigibson/examples/robots/import_custom_robot.py) wraps the native URDF Importer from Isaac Sim to convert our robot URDF model into USD format. Please see the following steps for running this script: 1. All that is required is a single source config yaml file that dictates how the URDF should be post-processed when being converted into a USD. You can run `import_custom_robot.py --help` to see a detailed example configuration used, which is also shown below (`r1_pro_source_config.yaml`) for your convenience. -2. All output files are written to `/objects/robot/`. Please move this directory to `/objects/` so it can be imported into **OmniGibson**. +2. All output files are written to `/objects/robot/`. Please move this directory to `/objects/` so it can be imported into **OmniGibson**. Some notes about the importing script: - The importing procedure can be summarized as follows: - 1. Copy the raw URDF file + any dependencies into the `gm.EXTERNAL_DATASET_PATH` directory + 1. Copy the raw URDF file + any dependencies into the `gm.CUSTOM_DATASET_PATH` directory 2. Updates the URDF + meshes to ensure all scaling is positive 3. Generates collision meshes for each robot link (as specified by the source config) 4. Generates metadata necessary for **OmniGibson** diff --git a/omnigibson/examples/objects/import_custom_object.py b/omnigibson/examples/objects/import_custom_object.py index 0624d6c05..688b95d29 100644 --- a/omnigibson/examples/objects/import_custom_object.py +++ b/omnigibson/examples/objects/import_custom_object.py @@ -62,7 +62,7 @@ def import_custom_object( ): """ Imports an externally-defined object asset into an OmniGibson-compatible USD format and saves the imported asset - files to the external dataset directory (gm.EXTERNAL_DATASET_PATH) + files to the external dataset directory (gm.CUSTOM_DATASET_PATH) """ assert len(model) == 6 and model.isalpha(), "Model name must be 6 characters long and contain only letters." collision_method = None if collision_method == "none" else collision_method diff --git a/omnigibson/examples/robots/import_custom_robot.py b/omnigibson/examples/robots/import_custom_robot.py index 48c765ef2..462812e7a 100644 --- a/omnigibson/examples/robots/import_custom_robot.py +++ b/omnigibson/examples/robots/import_custom_robot.py @@ -29,8 +29,8 @@ _DOCSTRING = """ -Imports an externally-defined robot URDF asset into an OmniGibson-compatible USD format and saves the imported asset -files to the external dataset directory (gm.EXTERNAL_DATASET_PATH) +Imports an custom-defined robot URDF asset into an OmniGibson-compatible USD format and saves the imported asset +files to the custom dataset directory (gm.CUSTOM_DATASET_PATH) Note that @config is expected to follow the following format (R1 config shown as an example): diff --git a/omnigibson/macros.py b/omnigibson/macros.py index de90df920..d76bb4532 100644 --- a/omnigibson/macros.py +++ b/omnigibson/macros.py @@ -60,8 +60,8 @@ def determine_gm_path(default_path, env_var_name): # can override assets_path and dataset_path from environment variable gm.ASSET_PATH = determine_gm_path(os.path.join("data", "assets"), "OMNIGIBSON_ASSET_PATH") gm.DATASET_PATH = determine_gm_path(os.path.join("data", "og_dataset"), "OMNIGIBSON_DATASET_PATH") -gm.EXTERNAL_DATASET_PATH = determine_gm_path( - os.path.join("data", "external_dataset"), "OMNIGIBSON_EXTERNAL_DATASET_PATH" +gm.CUSTOM_DATASET_PATH = determine_gm_path( + os.path.join("data", "custom_dataset"), "OMNIGIBSON_CUSTOM_DATASET_PATH" ) gm.KEY_PATH = determine_gm_path(os.path.join("data", "omnigibson.key"), "OMNIGIBSON_KEY_PATH") diff --git a/omnigibson/objects/dataset_object.py b/omnigibson/objects/dataset_object.py index a2058af2b..722ab2a06 100644 --- a/omnigibson/objects/dataset_object.py +++ b/omnigibson/objects/dataset_object.py @@ -27,7 +27,7 @@ class DatasetType(IntEnum): BEHAVIOR = 0 - EXTERNAL = 1 + CUSTOM = 1 class DatasetObject(USDObject): @@ -70,8 +70,8 @@ def __init__( Otherwise, will randomly sample a model given @category dataset_type (DatasetType): Dataset to search for this object. Default is BEHAVIOR, corresponding to the - proprietary (encrypted) BEHAVIOR-1K dataset (gm.DATASET_PATH). Possible values are {BEHAVIOR, EXTERNAL}. - If EXTERNAL, assumes asset is found at gm.EXTERNAL_DATASET_PATH and additionally not encrypted. + proprietary (encrypted) BEHAVIOR-1K dataset (gm.DATASET_PATH). Possible values are {BEHAVIOR, CUSTOM}. + If CUSTOM, assumes asset is found at gm.CUSTOM_DATASET_PATH and additionally not encrypted. scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale for this object. A single number corresponds to uniform scaling along the x,y,z axes, whereas a 3-array specifies per-axis scaling. @@ -167,7 +167,7 @@ def get_usd_path(cls, category, model, dataset_type=DatasetType.BEHAVIOR): Returns: str: Absolute filepath to the corresponding USD asset file """ - dataset_path = gm.DATASET_PATH if dataset_type == DatasetType.BEHAVIOR else gm.EXTERNAL_DATASET_PATH + dataset_path = gm.DATASET_PATH if dataset_type == DatasetType.BEHAVIOR else gm.CUSTOM_DATASET_PATH return os.path.join(dataset_path, "objects", category, model, "usd", f"{model}.usd") def sample_orientation(self): diff --git a/omnigibson/utils/asset_conversion_utils.py b/omnigibson/utils/asset_conversion_utils.py index 24bd453f6..85a5bc2ef 100644 --- a/omnigibson/utils/asset_conversion_utils.py +++ b/omnigibson/utils/asset_conversion_utils.py @@ -1128,7 +1128,7 @@ def import_obj_urdf( urdf_path, obj_category, obj_model, - dataset_root=gm.EXTERNAL_DATASET_PATH, + dataset_root=gm.CUSTOM_DATASET_PATH, use_omni_convex_decomp=False, use_usda=False, merge_fixed_joints=False, @@ -2018,7 +2018,7 @@ def get_collision_approximation_for_urdf( def copy_urdf_to_dataset( - urdf_path, category, mdl, dataset_root=gm.EXTERNAL_DATASET_PATH, suffix="original", overwrite=False + urdf_path, category, mdl, dataset_root=gm.CUSTOM_DATASET_PATH, suffix="original", overwrite=False ): # Create a directory for the object obj_dir = pathlib.Path(dataset_root) / "objects" / category / mdl / "urdf" @@ -2052,7 +2052,7 @@ def copy_urdf_to_dataset( def generate_urdf_for_obj( - visual_mesh, collision_meshes, category, mdl, dataset_root=gm.EXTERNAL_DATASET_PATH, overwrite=False + visual_mesh, collision_meshes, category, mdl, dataset_root=gm.CUSTOM_DATASET_PATH, overwrite=False ): # Create a directory for the object obj_dir = pathlib.Path(dataset_root) / "objects" / category / mdl @@ -2286,7 +2286,7 @@ def import_og_asset_from_urdf( no_decompose_links=None, visual_only_links=None, merge_fixed_joints=False, - dataset_root=gm.EXTERNAL_DATASET_PATH, + dataset_root=gm.CUSTOM_DATASET_PATH, hull_count=32, overwrite=False, use_usda=False,