-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Development] Add convert glb to usd objects. Issac Lab repo installation required. #2113
base: isaac_sim_dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some good progress here! I left some comments.
My biggest request is to add a test file (the last comment in usd_conversion_scene.py
).
Also, I see that pre-commit and python lint CI tests are failing (see below "Some checks are failing"). Try to get those passing. Have you installed pre-commit locally? See instructions.
Let me know when you've addressed my comments and I'll take another look!
habitat-lab/habitat/isaacsim/remote_content/object_glb/.gitignore
Outdated
Show resolved
Hide resolved
habitat-lab/habitat/isaacsim/remote_content/object_usd/.gitignore
Outdated
Show resolved
Hide resolved
local_download_folder = "/home/trandaniel/dev/IsaacSimConversion/usd_scene/" | ||
glb_data_folder = "/home/trandaniel/dev/habitat-sim/data/hssd-hab/objects" | ||
|
||
convert_scene_instance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add test/test_isaac_sim.py
to habitat-lab in this PR. Look at our other test files in that folder for reference. Let's have a test that tries to convert a toy habitat scene instance (this is something you suggested a while back). The test can assume the source assets are present on the machine (or maybe check for them and skip the test if they're missing). The test should inspect the output usda
file and check for expected contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrating unit tests and example data from PR #2123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to delete PR #2123 after unit tests are reviewed.
…itten by Eric Undersander.
…associated commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments. A few top-level comments:
- Let's add nice CLIs for both of these files. This means using argument-parsing and offering a friendly command-line interface.
- You need to fill out the PR description. What's autopopulated there is a template for you to edit. This is an important part of documenting a code change.
- As I requested earlier, let's add a minimal test file to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress here!
Please flesh out your PR description a bit. You don't have to explain what Isaac Sim is, but give some background for why we need these conversion utils. Mention that we convert scene instances including rigid objects (but not any included articulated objects or the stage yet). Mention the URDF conversion for converting robot URDF files. For Type of change, specify [Development].
Let's move meshColored
inside data/usd_conversion_data
so all the isaac-related test data is in one subfolder.
It looks like maybe you're not using test/data/usd_conversion_data/102343992.scene_instance.json
for testing, so you can remove it from this PR.
I suspect you don't need to add test/data/usd_conversion_data/objects_EXAMPLE2/1efdc3d37dfab1eb9f99117bb84c59003d684811.glb
to this repo, because it's a render GLB and it won't be used/loaded during the conversion (or am I missing something?). In general, we want to be really careful and selective about adding binary files to a git repo, since they are usually large.
@@ -0,0 +1 @@ | |||
24f1b688baf20921994b95e47f42b7ee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file for?
@@ -0,0 +1,245 @@ | |||
"""This module converts urdf files into usda files.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the base for this PR to isaac_sim_dev
instead of main
. Sorry I didn't do this earlier. The reason for this is that our entire integration is experimental and so we don't want it in main
yet.
Related to this, I chose habitat-lab/habitat/isaac_sim
as the location. Can you move your scripts inside this folder? How about habitat-lab/habitat/isaac_sim/asset_conversion/urdf_to_usd.py
and likewise for the other one.
stage_before_metadata = Usd.Stage.Open(converted_clean_usda) | ||
stage_output_metadata = Usd.Stage.Open(out_usd_filepath) | ||
|
||
# Add the habitatVisual metadata to each relevant prim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment looks wrong.
out_usd_filepath = urdf_dir + "hab_spot_arm_with_hab_metadata.usda" | ||
project_root_folder = repo_dir | ||
|
||
subprocess.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your test shouldn't run the script in a subprocess. Just import and run the required functionality directly.
convert_urdf(clean_urdf_filepath, output_usd) | ||
# TODO: Issac sim drops a prim. "Warning: Prim not found for link: fl_uleg" | ||
|
||
assert True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should do a real test here that checks something. At a minimum, check that the output file exists.
@@ -0,0 +1,18 @@ | |||
asset_path: /home/trandaniel/dev/habitat-lab/test/data/usd_conversion_data/hab_spot_arm_clean_CORRECT.urdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed in this PR? It looks like debug output from the conversion process.
def test_clean_urdf(): | ||
urdf_dir = repo_dir + "/test/data/usd_conversion_data/" | ||
input_file = urdf_dir + "hab_spot_arm_EXAMPLE.urdf" | ||
output_file = urdf_dir + "hab_spot_arm_clean.urdf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If hab_spot_arm_clean.urdf is generated by the test, then I guess hab_spot_arm_clean.urdf doesn't need to be included in this PR. It isn't a source file needed to run the test.
out_usd_path: str, | ||
project_root_folder: str, | ||
) -> None: | ||
"""This converts an hssd object to a usda file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just bumping this comment. Let's not name HSSD in comments.
Motivation and Context
This PR adds Issac Lab file type conversion capability. Issac lab will convert files into .usda.
How Has This Been Tested
Unit tests will be added to code function and the usda file output.
Types of changes
Checklist