Unverified Commit 5a15c6d3 authored by matthewtrepte's avatar matthewtrepte Committed by GitHub

Fixes rendering mode preset (#574)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->

Tweak rendering preset default behavior

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] 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
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->

---------
Signed-off-by: 's avatarmatthewtrepte <mtrepte@nvidia.com>
Signed-off-by: 's avatarKelly Guo <kellyg@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent 0058baa1
...@@ -18,16 +18,12 @@ Rendering modes can be selected in 2 ways. ...@@ -18,16 +18,12 @@ Rendering modes can be selected in 2 ways.
# scripts/tutorials/00_sim/set_rendering_mode.py # scripts/tutorials/00_sim/set_rendering_mode.py
render_cfg = sim_utils.RenderCfg(rendering_mode="performance") render_cfg = sim_utils.RenderCfg(rendering_mode="performance")
2. using the ``--rendering_mode`` CLI argument and not passing ``rendering_mode`` to :class:`~sim.RenderCfg`, since :class:`~sim.RenderCfg` takes precedence. 2. using the ``--rendering_mode`` CLI argument, which takes precedence over the ``rendering_mode`` argument in :class:`~sim.RenderCfg`.
.. code-block:: bash .. code-block:: bash
./isaaclab.sh -p scripts/tutorials/00_sim/set_rendering_mode.py --rendering_mode {performance/balanced/quality} ./isaaclab.sh -p scripts/tutorials/00_sim/set_rendering_mode.py --rendering_mode {performance/balanced/quality}
.. code-block:: bash
# in the tutorial script example, remove the rendering_mode passed to RenderCfg
render_cfg = sim_utils.RenderCfg()
Note, the ``rendering_mode`` defaults to ``balanced``. Note, the ``rendering_mode`` defaults to ``balanced``.
However, in the case where the launcher argument ``--enable_cameras`` is not set, then However, in the case where the launcher argument ``--enable_cameras`` is not set, then
......
...@@ -41,6 +41,7 @@ def main(): ...@@ -41,6 +41,7 @@ def main():
"""Main function.""" """Main function."""
# rendering modes include performance, balanced, and quality # rendering modes include performance, balanced, and quality
# note, the rendering_mode specified in the CLI argument (--rendering_mode) takes precedence over this Render Config setting
rendering_mode = "performance" rendering_mode = "performance"
# carb setting dictionary can include any rtx carb setting which will overwrite the native preset setting # carb setting dictionary can include any rtx carb setting which will overwrite the native preset setting
......
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.44.4" version = "0.44.5"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.44.5 (2025-07-28)
~~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Tweak default behavior for rendering preset modes.
0.44.4 (2025-07-18) 0.44.4 (2025-07-18)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
...@@ -868,13 +868,11 @@ class AppLauncher: ...@@ -868,13 +868,11 @@ class AppLauncher:
rendering_mode = launcher_args.get("rendering_mode") rendering_mode = launcher_args.get("rendering_mode")
if rendering_mode is None:
# use default kit rendering settings if cameras are disabled and a rendering mode is not selected # use default kit rendering settings if cameras are disabled and a rendering mode is not selected
if not self._enable_cameras and rendering_mode is None: if not self._enable_cameras:
return return
rendering_mode = ""
# default to balanced mode
if rendering_mode is None:
rendering_mode = "balanced"
# store rendering mode in carb settings # store rendering mode in carb settings
carb_settings = carb.settings.get_settings() carb_settings = carb.settings.get_settings()
......
...@@ -330,10 +330,15 @@ class SimulationContext(_SimulationContext): ...@@ -330,10 +330,15 @@ class SimulationContext(_SimulationContext):
not_carb_settings = ["rendering_mode", "carb_settings", "antialiasing_mode"] not_carb_settings = ["rendering_mode", "carb_settings", "antialiasing_mode"]
# grab rendering mode, defaulting first to the CLI arg --rendering_mode # grab the rendering mode using the following priority:
# 1. command line argument --rendering_mode, if provided
# 2. rendering_mode from Render Config, if set
# 3. lastly, default to "balanced" mode, if neither is specified
rendering_mode = get_carb_setting(self.carb_settings, "/isaaclab/rendering/rendering_mode") rendering_mode = get_carb_setting(self.carb_settings, "/isaaclab/rendering/rendering_mode")
if rendering_mode is None: if not rendering_mode:
rendering_mode = self.cfg.render.rendering_mode rendering_mode = self.cfg.render.rendering_mode
if not rendering_mode:
rendering_mode = "balanced"
# set preset settings (same behavior as the CLI arg --rendering_mode) # set preset settings (same behavior as the CLI arg --rendering_mode)
if rendering_mode is not None: if rendering_mode is not None:
...@@ -345,11 +350,10 @@ class SimulationContext(_SimulationContext): ...@@ -345,11 +350,10 @@ class SimulationContext(_SimulationContext):
) )
# parse preset file # parse preset file
# check if using isaac sim 4.5 and adjust path accordingly repo_path = os.path.join(carb.tokens.get_tokens_interface().resolve("${app}"), "..")
repo_path = os.path.join(carb.tokens.get_tokens_interface().resolve("${app}")) if float(".".join(self._isaacsim_version[2])) < 5:
if self._isaacsim_version[0] == 4 and self._isaacsim_version[1] == 5: repo_path = os.path.join(repo_path, "..")
repo_path = os.path.join(repo_path, "isaacsim_4_5") preset_filename = os.path.join(repo_path, f"apps/rendering_modes/{rendering_mode}.kit")
preset_filename = os.path.join(repo_path, f"rendering_modes/{rendering_mode}.kit")
with open(preset_filename) as file: with open(preset_filename) as file:
preset_dict = toml.load(file) preset_dict = toml.load(file)
preset_dict = dict(flatdict.FlatDict(preset_dict, delimiter=".")) preset_dict = dict(flatdict.FlatDict(preset_dict, delimiter="."))
......
...@@ -12,24 +12,25 @@ import os ...@@ -12,24 +12,25 @@ import os
ISAACLAB_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ISAACLAB_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
"""Path to the root directory of the Isaac Lab repository.""" """Path to the root directory of the Isaac Lab repository."""
DEFAULT_TIMEOUT = 200 DEFAULT_TIMEOUT = 300
"""The default timeout for each test in seconds.""" """The default timeout for each test in seconds."""
PER_TEST_TIMEOUTS = { PER_TEST_TIMEOUTS = {
"test_articulation.py": 500, "test_articulation.py": 500,
"test_rigid_object.py": 300, "test_rigid_object.py": 500,
"test_stage_in_memory.py": 500, "test_stage_in_memory.py": 500,
"test_environments.py": 2000, # This test runs through all the environments for 100 steps each "test_environments.py": 2000, # This test runs through all the environments for 100 steps each
"test_environments_with_stage_in_memory.py": ( "test_environments_with_stage_in_memory.py": (
1000 1000
), # Like the above, with stage in memory and with and without fabric cloning ), # Like the above, with stage in memory and with and without fabric cloning
"test_environment_determinism.py": 500, # This test runs through many the environments for 100 steps each "test_environment_determinism.py": 500, # This test runs through many the environments for 100 steps each
"test_factory_environments.py": 300, # This test runs through Factory environments for 100 steps each "test_factory_environments.py": 500, # This test runs through Factory environments for 100 steps each
"test_env_rendering_logic.py": 300, "test_env_rendering_logic.py": 500,
"test_multi_tiled_camera": 300, "test_multi_tiled_camera": 500,
"test_generate_dataset.py": 500, # This test runs annotation for 10 demos and generation until one succeeds "test_generate_dataset.py": 500, # This test runs annotation for 10 demos and generation until one succeeds
"test_operational_space.py": 300, "test_operational_space.py": 500,
"test_environments_training.py": 5000, "test_environments_training.py": 5000,
"test_simulation_render_config.py": 500,
} }
"""A dictionary of tests and their timeouts in seconds. """A dictionary of tests and their timeouts in seconds.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment