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

Upgrades the repo to the latest version of IsaacLab #32

Merged
merged 31 commits into from
Oct 22, 2024
Merged

Conversation

pascal-roth
Copy link
Collaborator

Description

This PR updates the code to the newer version of IsaacLab. Moreover, it removes the need for link the repo orbit_envs.

@pascal-roth pascal-roth self-assigned this Oct 21, 2024
@pascal-roth pascal-roth added the enhancement New feature or request label Oct 21, 2024
@pascal-roth
Copy link
Collaborator Author

@fan-ziqi I added your changes here along with some more updates. Please let me know if everything still works for you, then we can update and merge the repo.

@heyshouzi if you merge this PR already in the local copy, everything should work and the locomotion policy should be found

@fan-ziqi
Copy link
Contributor

Thank you for your approval. I will test your modifications now. and if everything works without errors, I will reply under this PR.

@pascal-roth
Copy link
Collaborator Author

@fan-ziqi thanks a lot, will address the comments now

@fan-ziqi
Copy link
Contributor

I found that the robot uses GroundPlane as the reference plane for height_scanner, but it is still making contact with the uneven green terrain below the ground, causing the robot to fall.
GroundPlane
So I wonder if this process is incorrect?

@pascal-roth
Copy link
Collaborator Author

I found that the robot uses GroundPlane as the reference plane for height_scanner, but it is still making contact with the uneven green terrain below the ground, causing the robot to fall. GroundPlane So I wonder if this process is incorrect?

no, thats not the same as the behavior in my local environment. I will update the online asset

@fan-ziqi
Copy link
Contributor

Ok, I'll wait for your new model for testing.

I found that the robot uses GroundPlane as the reference plane for height_scanner, but it is still making contact with the uneven green terrain below the ground, causing the robot to fall. GroundPlane So I wonder if this process is incorrect?

no, thats not the same as the behavior in my local environment. I will update the online asset

@fan-ziqi
Copy link
Contributor

fan-ziqi commented Oct 21, 2024

I don’t have any other questions on my side aside from the ones mentioned above. I will contact you via email about training data collection.
Due to the time difference, I will respond to your message or continue following up on the testing tomorrow. Wishing you a wonderful day!

@pascal-roth
Copy link
Collaborator Author

@fan-ziqi, thanks a lot again for the detailed feedback; I fixed all the remarks that you had.

For the problems with Carla, please download the asset again (it now has colliders enabled).

Regarding point 1), this extension is not ported as it is not necessary for the demo scripts.

@pascal-roth
Copy link
Collaborator Author

@fan-ziqi let me know if there are any new bugs for you, otherwise I merge it by the end of the day. Thanks again for your help

@fan-ziqi
Copy link
Contributor

I discovered an issue and resolved it. Here’s the problem description and solution:

When using the convert_mesh.py script to convert .obj to .usd, if user uses the 2n8kARJN3HM scene mentioned in README, the conversion will fail.

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: <>'

The reason is that 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.

I think it’s necessary to mention this in README, as the error message doesn’t indicate the underlying problem.

Perhaps we should inform the IsaacLab team to 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.

@pascal-roth
Copy link
Collaborator Author

I discovered an issue and resolved it. Here’s the problem description and solution:

When using the convert_mesh.py script to convert .obj to .usd, if user uses the 2n8kARJN3HM scene mentioned in README, the conversion will fail.

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: <>'

The reason is that 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.

I think it’s necessary to mention this in README, as the error message doesn’t indicate the underlying problem.

Perhaps we should inform the IsaacLab team to 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.

Great find! We can make a note in the readme about it and make an issue in IsaacLab

@pascal-roth
Copy link
Collaborator Author

Any other issues you encountered?

@fan-ziqi
Copy link
Contributor

Yes, I will send it out asap.

@fan-ziqi
Copy link
Contributor

The conversion script generates two USD files: *.usd and *_non_metric.usd.

When I test using the *.usd file converted by the script, the robot keeps resetting infinitely (I have already followed the documentation to fix the coordinate system and scaling factors), which seems to be a bug. I haven't been able to find the cause of the issue.

bandicam.2024-10-22.20-06-12-354.mp4

However, when I use the *_non_metric.usd, which is the original file, the robot runs correctly.

bandicam.2024-10-22.20-07-10-873.mp4

In addition, even if I don't fix the coordinate system and scaling factors after running the conversion script and simply save the file, the *_non_metric.usd still works fine. Therefore, I believe the 2nd step of the doc is unnecessary, users can directly use *_non_metric.usd file.

@pascal-roth
Copy link
Collaborator Author

In this case, the conversion function has been updated. Personally, I converted the assets a long time ago. I will add another node that the *_non_metric.usd should be used.

Thanks for investigating that.

@fan-ziqi
Copy link
Contributor

fan-ziqi commented Oct 22, 2024

self.scene.robot.init_state.rot = (0.0, 0.0, 0.258819, -0.9659258)

The quaternion rotation axis for Carla is incorrect; the initial state in the code rotates around its own roll. It should be changed to the following(yaw -90), so the robot can initialize properly without falling.

self.scene.robot.init_state.rot = (0.707, 0.0, 0.0, -0.707)

@fan-ziqi
Copy link
Contributor

After testing, on my side, there are no more bugs in the demo section so far. Below are the final recordings of the three scenes, which I hope can provide new users with some correct references.

Matterport

viplanner-matterport.mp4

Carla

viplanner-carla.mp4

Warehouse

viplanner-warehouse.mp4

I think you can merge after fixing the above issues.

Finally, thank you for your outstanding contributions to this project; it's been a pleasure collaborating with you.

@pascal-roth
Copy link
Collaborator Author

great, thank you so much. Fixed the rotation now.

@pascal-roth pascal-roth merged commit 5fc8a3e into main Oct 22, 2024
1 check failed
@pascal-roth pascal-roth deleted the dev/upgrade branch October 22, 2024 13:02
@fan-ziqi
Copy link
Contributor

I discovered an issue and resolved it. Here’s the problem description and solution:

When using the convert_mesh.py script to convert .obj to .usd, if user uses the 2n8kARJN3HM scene mentioned in README, the conversion will fail.

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: <>'

The reason is that 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.

I think it’s necessary to mention this in README, as the error message doesn’t indicate the underlying problem.

Perhaps we should inform the IsaacLab team to 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.

I've opened a issue here isaac-sim/IsaacLab#1287

@fan-ziqi
Copy link
Contributor

I discovered an issue and resolved it. Here’s the problem description and solution:
When using the convert_mesh.py script to convert .obj to .usd, if user uses the 2n8kARJN3HM scene mentioned in README, the conversion will fail.

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: <>'

The reason is that 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.
I think it’s necessary to mention this in README, as the error message doesn’t indicate the underlying problem.
Perhaps we should inform the IsaacLab team to 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.

I've opened a issue here isaac-sim/IsaacLab#1287

Fixed here isaac-sim/IsaacLab#1302

If merging is possible, the documents for this project need to be modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] isaac sim 4.2 simulation problem in dev/upgrade branch
2 participants