Skip to content

Commit bf68943

Browse files
authored
Adds Kit command line argument support (#1293)
# Description This change adds the option to pass command line arguments directly to OV kit. This avoids the need of having to modify the app files to change settings for OV. ## Type of change - New feature (non-breaking change which adds functionality) ## 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 - [ ] 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
1 parent 77133d5 commit bf68943

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

isaaclab.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ while [[ $# -gt 0 ]]; do
350350
python_exe=$(extract_python_exe)
351351
echo "[INFO] Using python from: ${python_exe}"
352352
shift # past argument
353-
${python_exe} $@
353+
${python_exe} "$@"
354354
# exit neatly
355355
break
356356
;;

source/extensions/omni.isaac.lab/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.27.1"
4+
version = "0.27.2"
55

66
# Description
77
title = "Isaac Lab framework for Robot Learning"

source/extensions/omni.isaac.lab/docs/CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
---------
33

4+
0.27.2 (2024-10-21)
5+
~~~~~~~~~~~~~~~~~~~
6+
7+
Added
8+
^^^^^
9+
10+
* Added ``--kit_args`` to :class:`~omni.isaac.lab.app.AppLauncher` to allow passing command line arguments directly to Omniverse Kit SDK.
11+
12+
413
0.27.1 (2024-10-20)
514
~~~~~~~~~~~~~~~~~~~
615

source/extensions/omni.isaac.lab/omni/isaac/lab/app/app_launcher.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def add_app_launcher_args(parser: argparse.ArgumentParser) -> None:
185185
* If headless and enable_cameras are False, the experience file is set to ``isaaclab.python.kit``.
186186
* If headless is True and enable_cameras is False, the experience file is set to ``isaaclab.python.headless.kit``.
187187
188+
* ``kit_args`` (str): Optional command line arguments to be passed to Omniverse Kit directly.
189+
Arguments should be combined into a single string separated by space.
190+
Example usage: --kit_args "--ext-folder=/path/to/ext1 --ext-folder=/path/to/ext2"
191+
188192
Args:
189193
parser: An argument parser instance to be extended with the AppLauncher specific options.
190194
"""
@@ -271,6 +275,15 @@ def add_app_launcher_args(parser: argparse.ArgumentParser) -> None:
271275
" it is resolved relative to the `apps` folder in Isaac Sim and Isaac Lab (in that order)."
272276
),
273277
)
278+
arg_group.add_argument(
279+
"--kit_args",
280+
type=str,
281+
default="",
282+
help=(
283+
"Command line arguments for Omniverse Kit as a string separated by a space delimiter."
284+
' Example usage: --kit_args "--ext-folder=/path/to/ext1 --ext-folder=/path/to/ext2"'
285+
),
286+
)
274287

275288
# Corresponding to the beginning of the function,
276289
# if we have removed -h/--help handling, we add it back.
@@ -557,6 +570,12 @@ def _config_resolution(self, launcher_args: dict):
557570
" The file does not exist."
558571
)
559572

573+
# Resolve additional arguments passed to Kit
574+
self._kit_args = []
575+
if "kit_args" in launcher_args:
576+
self._kit_args = [arg for arg in launcher_args["kit_args"].split()]
577+
sys.argv += self._kit_args
578+
560579
# Resolve the absolute path of the experience file
561580
self._sim_experience_file = os.path.abspath(self._sim_experience_file)
562581
print(f"[INFO][AppLauncher]: Loading experience file: {self._sim_experience_file}")
@@ -595,6 +614,9 @@ def _create_app(self):
595614
# remove the threadCount argument from sys.argv if it was added for distributed training
596615
pattern = r"--/plugins/carb\.tasking\.plugin/threadCount=\d+"
597616
sys.argv = [arg for arg in sys.argv if not re.match(pattern, arg)]
617+
# remove additional OV args from sys.argv
618+
if len(self._kit_args) > 0:
619+
sys.argv = [arg for arg in sys.argv if arg not in self._kit_args]
598620

599621
def _rendering_enabled(self) -> bool:
600622
"""Check if rendering is required by the app."""

0 commit comments

Comments
 (0)