Skip to content

Commit

Permalink
Fixes loading of material from MDL file (#268)
Browse files Browse the repository at this point in the history
# Description

The Nucleus directory for materials has changed in 2023.1. They are now
directly inside `NVIDIA/Materials` instead of `NVIDIA/Assets/Materials`.
This MR fixes the referenced directory.

## Type of change

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

## Screenshots

This is how the rough terrain looks like now:

![shingle_ground](https://github.com/isaac-orbit/orbit/assets/12863862/c561f664-22bb-45d1-a713-9d95ec48feda)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] 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
  • Loading branch information
Mayankm96 committed Dec 3, 2023
1 parent f98eebc commit aaab27b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/extensions/omni.isaac.orbit/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.9.54"
version = "0.9.55"

# Description
title = "ORBIT framework for Robot Learning"
Expand Down
10 changes: 10 additions & 0 deletions source/extensions/omni.isaac.orbit/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
---------

0.9.55 (2023-12-03)
~~~~~~~~~~~~~~~~~~~

Fixed
^^^^^

* Fixed the Nucleus directory path in the :attr:`omni.isaac.orbit.utils.assets.NVIDIA_NUCLEUS_DIR`.
Earlier, it was referring to the ``NVIDIA/Assets`` directory instead of ``NVIDIA``.


0.9.54 (2023-11-29)
~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ class MdlFileCfg(VisualMaterialCfg):
NVIDIA Omniverse provides various MDL materials in the NVIDIA Nucleus.
To use these materials, you can set the path of the material in the nucleus directory
using the ``{NVIDIA_NUCLEUS_DIR}`` variable.
using the ``{NVIDIA_NUCLEUS_DIR}`` variable. This is internally resolved to the path of the
NVIDIA Nucleus directory on the host machine through the attribute
:attr:`omni.isaac.orbit.utils.assets.NVIDIA_NUCLEUS_DIR`.
For example, to use the "Brick_Wall_Brown" material, you can set the path to:
``{NVIDIA_NUCLEUS_DIR}/Materials/Brick_Wall_Brown/Brick_Wall_Brown.mdl``.
For example, to use the "Aluminum_Anodized" material, you can set the path to:
``{NVIDIA_NUCLEUS_DIR}/Materials/Base/Metals/Aluminum_Anodized.mdl``.
"""
project_uvw: bool | None = None
"""Whether to project the UVW coordinates of the material. Defaults to None.
Expand All @@ -76,6 +77,11 @@ class MdlFileCfg(VisualMaterialCfg):
If None, then the default setting in the MDL material will be used.
"""
texture_scale: tuple[float, float] | None = None
"""The scale of the texture. Defaults to None.
If None, then the default setting in the MDL material will be used.
"""


@configclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
carb.log_error(msg)
raise RuntimeError(msg)

NVIDIA_NUCLEUS_DIR = nucleus_utils.get_nvidia_asset_root_path()
NVIDIA_NUCLEUS_DIR = f"{nucleus_utils.get_assets_root_path()}/NVIDIA"
"""Path to the root directory on the NVIDIA Nucleus Server."""

ISAAC_NUCLEUS_DIR = f"{nucleus_utils.get_assets_root_path()}/Isaac"
"""Path to the `Isaac` directory on the NVIDIA Nucleus Server."""

ISAAC_ORBIT_NUCLEUS_DIR = f"{nucleus_utils.get_assets_root_path()}/Isaac/Samples/Orbit"
ISAAC_ORBIT_NUCLEUS_DIR = f"{ISAAC_NUCLEUS_DIR}/Samples/Orbit"
"""Path to the `Isaac/Samples/Orbit` directory on the NVIDIA Nucleus Server."""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class MySceneCfg(InteractiveSceneCfg):
static_friction=1.0,
dynamic_friction=1.0,
),
visual_material=sim_utils.MdlFileCfg(
mdl_path="{NVIDIA_NUCLEUS_DIR}/Materials/Base/Architecture/Shingles_01.mdl",
project_uvw=True,
),
debug_vis=False,
)
# robots
Expand All @@ -74,6 +78,10 @@ class MySceneCfg(InteractiveSceneCfg):
prim_path="/World/light",
spawn=sim_utils.DistantLightCfg(color=(0.75, 0.75, 0.75), intensity=3000.0),
)
sky_light = AssetBaseCfg(
prim_path="/World/skyLight",
spawn=sim_utils.DomeLightCfg(color=(0.13, 0.13, 0.13), intensity=1000.0),
)


##
Expand Down

0 comments on commit aaab27b

Please sign in to comment.