Skip to content
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

[Bug Report] convert_mesh.py failed when *.obj file name starts with a number #1287

Closed
2 tasks done
fan-ziqi opened this issue Oct 22, 2024 · 0 comments · Fixed by #1302
Closed
2 tasks done

[Bug Report] convert_mesh.py failed when *.obj file name starts with a number #1287

fan-ziqi opened this issue Oct 22, 2024 · 0 comments · Fixed by #1302

Comments

@fan-ziqi
Copy link
Contributor

fan-ziqi commented Oct 22, 2024

Describe the bug

When using the convert_mesh.py script to convert .obj to .usd, if the obj file in this scene starts with a number(0c334eaabb844eaaad049cbbb2e0a4f2.obj), while the USD API prohibits names that start with a number Link. This issue is described in more detail here: Link.

Usd.Stage.Open(rootLayer=Sdf.Find('anon:0x23b593e0:tmp.usda'), sessionLayer=Sdf.Find('anon:0x23b3f000:tmp-session.usda'), pathResolverContext=<invalid repr>)
2024-10-22 11:14:00 [5,398ms] [Warning] [omni.usd] Warning: in SdfPath at line 81 of /builds/omniverse/usd-ci/USD/pxr/usd/sdf/path.cpp -- Ill-formed SdfPath </0c334eaabb844eaaad049cbbb2e0a4f2>: syntax error

Traceback (most recent call last):
  File "/home/ubuntu/workspaces/viplanner_ws/viplanner/../IsaacLab/source/standalone/tools/convert_mesh.py", line 177, in <module>
    main()
  File "/home/ubuntu/workspaces/viplanner_ws/viplanner/../IsaacLab/source/standalone/tools/convert_mesh.py", line 147, in main
    mesh_converter = MeshConverter(mesh_converter_cfg)
  File "/home/ubuntu/workspaces/viplanner_ws/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/converters/mesh_converter.py", line 58, in __init__
    super().__init__(cfg=cfg)
  File "/home/ubuntu/workspaces/viplanner_ws/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/converters/asset_converter_base.py", line 104, in __init__
    self._convert_asset(cfg)
  File "/home/ubuntu/workspaces/viplanner_ws/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/converters/mesh_converter.py", line 85, in _convert_asset
    asyncio.get_event_loop().run_until_complete(
  File "/home/ubuntu/anaconda3/envs/viplanner/lib/python3.10/site-packages/omni/extscore/omni.kit.async_engine/omni/kit/async_engine/async_engine.py", line 160, in run_until_complete
    return self.super_run_until_complete(future)
  File "/home/ubuntu/anaconda3/envs/viplanner/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/ubuntu/workspaces/viplanner_ws/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/sim/converters/mesh_converter.py", line 223, in _convert_mesh_to_usd
    base_prim = temp_stage.DefinePrim(prim_path, "Xform")
pxr.Tf.ErrorException: 
	Error in 'pxrInternal_v0_22__pxrReserved__::UsdStage::_IsValidPathForCreatingPrim' at line 3340 in file /builds/omniverse/usd-ci/USD/pxr/usd/usd/stage.cpp : 'Path must be an absolute path: <>'

Perhaps we should modify the _convert_asset() function in convert_mesh.py script to throw a user-friendly warning when the mesh_file_basename does not comply with the USD file format.

This issue was first encountered in leggedrobotics/viplanner#32 (comment)

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo
iamdrfly pushed a commit to iamdrfly/IsaacLab that referenced this issue Nov 21, 2024
…isaac-sim#1302)

# Description

Fixes isaac-sim#1287

**Issue details**: When using the convert_mesh.py script to convert .obj
to .usd, if the obj file in this scene starts with a
number(0c334eaabb844eaaad049cbbb2e0a4f2.obj), while the USD API
prohibits names that start with a number
[Link](https://openusd.org/release/api/group__group__tf___string.html#gaa129b294af3f68d01477d430b70d40c8).
This issue is described in more detail here:
[Link](https://forums.developer.nvidia.com/t/cant-create-prims-if-name-starts-with-number/249617).

Also deleted useless debugging output code.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
adrian-sch pushed a commit to adrian-sch/IsaacLab that referenced this issue Dec 6, 2024
…isaac-sim#1302)

# Description

Fixes isaac-sim#1287

**Issue details**: When using the convert_mesh.py script to convert .obj
to .usd, if the obj file in this scene starts with a
number(0c334eaabb844eaaad049cbbb2e0a4f2.obj), while the USD API
prohibits names that start with a number
[Link](https://openusd.org/release/api/group__group__tf___string.html#gaa129b294af3f68d01477d430b70d40c8).
This issue is described in more detail here:
[Link](https://forums.developer.nvidia.com/t/cant-create-prims-if-name-starts-with-number/249617).

Also deleted useless debugging output code.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant