Skip to content

Commit 06a0f31

Browse files
authored
Merge branch 'develop' into codex/benchmark-camera-resolution
2 parents ceca11e + 493ee92 commit 06a0f31

81 files changed

Lines changed: 3028 additions & 2339 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/license-check.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ jobs:
6868
# ``UNKNOWN``, which license-exceptions.json keys on, and joins multi-license
6969
# strings unsorted. Cap below 6.0 until 6.x ships stable and is re-reviewed.
7070
bash "$GITHUB_WORKSPACE/.github/actions/_lib/with-python-package-retries.sh" \
71-
uv pip install "pip-licenses<6.0" pipdeptree \
72-
-r tools/template/requirements.txt
71+
uv pip install "pip-licenses<6.0" pipdeptree
7372
# Put the venv on PATH for later steps.
7473
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
7574

docs/index.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Table of Contents
9292
source/setup/installation/index
9393
source/setup/environments
9494
source/setup/quickstart
95+
source/setup/tutorial
9596
source/migration/migrating_to_isaaclab_3-0
9697

9798

@@ -112,8 +113,6 @@ Table of Contents
112113
:caption: Getting Started
113114
:titlesonly:
114115

115-
source/overview/own-project/index
116-
source/setup/walkthrough/index
117116
source/tutorials/index
118117
source/how-to/index
119118
source/overview/developer-guide/index
@@ -147,6 +146,13 @@ Table of Contents
147146
source/features/visualizer_tiled_camera
148147

149148

149+
.. toctree::
150+
:maxdepth: 2
151+
:caption: Developer Tools
152+
153+
source/developer-tools/template_generator
154+
155+
150156
.. toctree::
151157
:maxdepth: 3
152158
:caption: Experimental Features
-181 KB
Binary file not shown.
-106 KB
Binary file not shown.

docs/source/_static/setup/walkthrough_project_setup.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/_static/setup/walkthrough_sim_stage_scene.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/_static/setup/walkthrough_stage_context.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/_static/setup/walkthrough_training_vectors.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/concepts/actuators.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ estimates effort telemetry from the current state when the backend does not expo
227227
torque limit at :math:`\pm\,\tau_{max}`.
228228

229229
**DCMotor.** Adds a linear four-quadrant torque-speed curve. ``saturation_effort`` is the stall
230-
torque, and ``actuator_velocity_limit`` is the no-load speed.
230+
torque, and ``actuator_velocity_limit`` is the no-load speed. Both accept a joint-name-pattern
231+
dictionary, so joints behind different gear reductions can share one group and still get their own
232+
curve — for example a quadruped whose knee sits behind an extra reduction relative to its hip.
231233

232234
**DelayedPDActuator.** An ideal PD controller with delayed position, velocity, and effort commands.
233235
The delay is sampled uniformly from ``[min_delay, max_delay]`` at reset.
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
.. _own-project:
2+
.. _template-generator:
3+
4+
Build your own project or task
5+
==============================
6+
7+
The template generator bootstraps the package structure, task registration, and
8+
agent configurations needed to start developing an Isaac Lab task. Use it to
9+
create either a standalone project outside Isaac Lab or a task intended for
10+
contribution to the Isaac Lab repository. Both options include a working
11+
Cartpole example that you can replace with your own environment.
12+
13+
Choose what to generate
14+
-----------------------
15+
16+
The first prompt chooses where the new task will live.
17+
18+
.. list-table::
19+
:widths: 22 48 30
20+
:header-rows: 1
21+
22+
* - Type
23+
- Use it when
24+
- Result
25+
* - External (recommended)
26+
- You are creating an application, experiment, or reusable project outside
27+
the Isaac Lab repository.
28+
- A standalone, installable uv project using a ``src`` layout.
29+
* - Internal
30+
- You intend to contribute the task to the Isaac Lab repository.
31+
- A task package under ``source/isaaclab_tasks``.
32+
33+
Installed Isaac Lab wheels only offer external projects. The internal option is
34+
available from a source checkout because it writes directly into that checkout.
35+
36+
Next, choose one or more task workflows. See :ref:`feature-workflows` for the
37+
complete comparison.
38+
39+
.. list-table::
40+
:widths: 30 70
41+
:header-rows: 1
42+
43+
* - Workflow
44+
- Good fit
45+
* - Manager-based | single-agent
46+
- Most new tasks. Observations, actions, rewards, events, and terminations
47+
remain modular and easy to replace.
48+
* - Direct | single-agent
49+
- Tasks that need custom step and reset control or a compact environment
50+
implementation.
51+
* - Direct | multi-agent
52+
- Tasks with multiple policies or agent-specific observation and action
53+
spaces.
54+
55+
Finally, choose the RL libraries and algorithms whose configuration files you
56+
want generated. The prompt adapts the available choices to the selected
57+
workflow. See :ref:`rl-frameworks` for the framework comparison.
58+
59+
Create and run an external project
60+
----------------------------------
61+
62+
First, :ref:`install Isaac Lab <isaaclab-installation-root>`. Run the generator
63+
from the Isaac Lab source checkout or from a uv project that contains the
64+
installed Isaac Lab package:
65+
66+
.. code-block:: bash
67+
68+
uv run isaaclab --new
69+
70+
The command uses the dependencies from the active Isaac Lab environment. It
71+
does not invoke ``pip`` or install another set of template dependencies, so it
72+
also works in the pip-less virtual environments created by ``uv``.
73+
74+
The short form is equivalent:
75+
76+
.. code-block:: bash
77+
78+
uv run isaaclab -n
79+
80+
Select the following options for a small first project:
81+
82+
* **External** project
83+
* A parent directory outside the Isaac Lab repository
84+
* A Python-compatible project name, such as ``my_robot_project``
85+
* A task family name, such as ``balance``
86+
* A robot/config name, such as ``cartpole``
87+
* **No** Isaac Sim UI extension for a headless task package
88+
* **Manager-based | single-agent** workflow
89+
* **rsl_rl** with **PPO**
90+
91+
The prompts display the valid options and accept numbered, comma-separated
92+
selections when more than one choice is allowed. The generator creates the
93+
project under ``<parent-directory>/<project-name>`` and initializes a Git
94+
repository there.
95+
96+
Enter the generated project and create its environment:
97+
98+
.. code-block:: bash
99+
100+
cd <parent-directory>/my_robot_project
101+
uv sync
102+
103+
This default environment includes the selected RL library and the kit-less
104+
Newton backend. It does **not** install Isaac Sim.
105+
106+
List the generated task name and its available presets:
107+
108+
.. code-block:: bash
109+
110+
uv run python scripts/list_envs.py --show_presets
111+
112+
Copy the task name from the output, then run a quick smoke test:
113+
114+
.. code-block:: bash
115+
116+
uv run isaaclab random_agent --task <TASK_NAME> --num_envs 16 --viz newton
117+
118+
If the environment launches and the cart moves, the project is ready to edit.
119+
You can then train and play a policy with the same command surface used by
120+
Isaac Lab itself:
121+
122+
.. code-block:: bash
123+
124+
uv run isaaclab train --rl_library rsl_rl --task <TASK_NAME>
125+
uv run isaaclab play --rl_library rsl_rl --task <TASK_NAME> --checkpoint latest --viz newton
126+
127+
Choose a simulation backend
128+
---------------------------
129+
130+
The default ``uv sync`` installs the kit-less Newton backend without Isaac Sim.
131+
Use a generated ``isaacsim``, ``ov``, ``ovphysx``, or ``ovrtx`` extra when a
132+
command needs that optional runtime. For example:
133+
134+
.. code-block:: bash
135+
136+
uv run --extra isaacsim isaaclab random_agent \
137+
--task <TASK_NAME> physics=isaacsim_physx
138+
139+
Place ``--extra`` before ``isaaclab`` and keep it on every command that needs
140+
the optional runtime. See :ref:`backends-and-presets` for the backend and preset
141+
model and :ref:`isaac-lab-quickstart` for supported physics, renderer, and
142+
visualizer combinations.
143+
144+
.. _project-structure:
145+
146+
Understand the generated project
147+
--------------------------------
148+
149+
An external project is a single installable Python package with the same
150+
standard uv ``src`` layout used by maintained downstream examples. Its root
151+
``pyproject.toml`` declares the package, development tools, backend extras, and
152+
``isaaclab.tasks`` entry point.
153+
154+
The project name identifies the repository and Python package. Task-wide MDP
155+
terms live under the separately named task family. Robot-specific scenes,
156+
registrations, and agent configurations live under ``config/<robot-name>``.
157+
This separation lets a project add another robot configuration without copying
158+
the task MDP, or add another task family without creating another repository.
159+
160+
Code shared by several task families can live in a package such as
161+
``tasks/mdp``. The generated task importer skips packages named ``mdp`` while it
162+
searches for task registrations, so shared modules do not register as task
163+
families.
164+
165+
A generated project resembles:
166+
167+
.. code-block:: text
168+
169+
my_robot_project/
170+
├── LICENSE
171+
├── pyproject.toml
172+
├── README.md
173+
├── scripts/
174+
│ └── list_envs.py
175+
├── src/
176+
│ └── my_robot_project/
177+
│ ├── __init__.py
178+
│ └── tasks/
179+
│ ├── __init__.py
180+
│ └── balance/
181+
│ ├── mdp/
182+
│ └── config/
183+
│ └── cartpole/
184+
│ ├── agents/
185+
│ └── env_cfg.py
186+
└── tests/
187+
└── test_registration.py
188+
189+
The generated package ``__init__.py`` is intentionally passive. Installing the
190+
project exposes ``my_robot_project.tasks`` through the ``isaaclab.tasks`` entry
191+
point, so importing the package for utilities does not eagerly register tasks.
192+
193+
If you opt into the Isaac Sim UI extension, the generator additionally creates
194+
``config/extension.toml`` and ``src/my_robot_project/ui_extension_example.py``.
195+
Launch Isaac Sim with the generated ``isaacsim`` extra when using it. The
196+
default is a headless task package and does not include these files.
197+
198+
Run commands from the project root so ``uv`` can find the package and task entry
199+
point. Commit ``pyproject.toml`` and ``uv.lock`` to give collaborators the same
200+
dependency resolution.
201+
202+
Develop the generated task
203+
--------------------------
204+
205+
Start with a dummy agent before training. A zero-action agent is useful for
206+
checking resets and passive dynamics, while a random-action agent also exercises
207+
the action and observation paths:
208+
209+
.. code-block:: bash
210+
211+
uv run isaaclab zero_agent --task <TASK_NAME> --num_envs 16
212+
uv run isaaclab random_agent --task <TASK_NAME> --num_envs 16
213+
214+
Edit the generated environment configuration and task terms under
215+
``src/<project-name>/tasks``. The generated package is
216+
installed in editable mode, so you do not need to reinstall it after each
217+
change.
218+
219+
Use the remaining project commands as the task matures:
220+
221+
.. code-block:: bash
222+
223+
uv run isaaclab train_multigpu --rl_library <RL_LIBRARY> \
224+
--task <TASK_NAME> --num_gpus 2
225+
uv run isaaclab benchmark runtime --task <TASK_NAME> \
226+
--num_envs 16 --num_steps 1000
227+
uv run pre-commit run --all-files
228+
229+
The generator includes ``tests/test_registration.py`` to verify the task IDs,
230+
environment entry points, and default agent. Its ``pyproject.toml`` installs
231+
pytest for development and registers the ``unit``, ``integration``, ``smoke``,
232+
and ``kitless`` markers. Add project-owned behavioral tests under ``tests`` and
233+
run them with:
234+
235+
.. code-block:: bash
236+
237+
uv run pytest tests
238+
239+
The reusable-looking helpers under ``source/isaaclab_tasks/test`` belong to the
240+
Isaac Lab repository test suite and are not installed with ``isaaclab_tasks``.
241+
External projects should build their environment harness from public APIs and
242+
maintain project-local fixtures. Copying ``env_test_utils.py`` into a project is
243+
vendoring it, so the project must track upstream changes to that copy.
244+
245+
To configure VS Code, run the generated setup task or invoke it directly:
246+
247+
.. code-block:: bash
248+
249+
uv run python .vscode/tools/setup_vscode.py
250+
251+
Create an internal task
252+
-----------------------
253+
254+
Choose **Internal** only when working from an Isaac Lab source checkout. The
255+
generator writes the new task into ``source/isaaclab_tasks`` instead of creating
256+
a separate project. From the Isaac Lab repository root, list and test it with:
257+
258+
.. code-block:: bash
259+
260+
uv run python scripts/environments/list_envs.py --show_presets
261+
uv run isaaclab random_agent --task <TASK_NAME> --num_envs 16
262+
uv run isaaclab train --rl_library <RL_LIBRARY> --task <TASK_NAME>
263+
264+
Troubleshooting
265+
---------------
266+
267+
**The project path is rejected**
268+
External projects must live outside the Isaac Lab repository. Enter the
269+
parent directory; the generator appends the project name automatically.
270+
271+
**The project name is rejected**
272+
Use a valid Python identifier containing letters, numbers, and underscores,
273+
without spaces or hyphens. The name cannot begin with a number.
274+
275+
**The task family or robot/config name is rejected**
276+
Use a valid Python identifier for each name. These names become package
277+
directories under ``src/<project-name>/tasks``.
278+
279+
**The CLI cannot find the generated task**
280+
Run ``uv sync`` and invoke the command from the generated project root. Then
281+
confirm the task appears in ``uv run python scripts/list_envs.py``.
282+
283+
**An optional backend module is missing**
284+
Add its extra before the command, such as ``uv run --extra ovphysx
285+
isaaclab ...`` or ``uv run --extra isaacsim isaaclab ...``.
286+
287+
**The generator reports a missing template dependency**
288+
Current versions obtain the renderer and prompts from the Isaac Lab
289+
environment; no manual ``pip install`` is required. Update the Isaac Lab
290+
checkout or installed package and run the generator again.
291+
292+
The generated ``README.md`` contains the same project-local commands and should
293+
be kept up to date as the project evolves.

0 commit comments

Comments
 (0)