|
1 | | -Building your Own Project |
2 | | -========================= |
| 1 | +.. _template-generator: |
| 2 | + |
| 3 | +Build your Own Project or Task |
| 4 | +============================== |
3 | 5 |
|
4 | 6 | Traditionally, building new projects that utilize Isaac Lab's features required creating your own |
5 | 7 | extensions within the Isaac Lab repository. However, this approach can obscure project visibility and |
6 | | -complicate updates from one version of Isaac Lab to another. To circumvent these challenges, we now |
7 | | -provide a pre-configured and customizable `extension template <https://github.com/isaac-sim/IsaacLabExtensionTemplate>`_ |
8 | | -for creating projects in an isolated environment. |
| 8 | +complicate updates from one version of Isaac Lab to another. To circumvent these challenges, |
| 9 | +we now provide a command-line tool (**template generator**) for creating Isaac Lab-based projects and tasks. |
9 | 10 |
|
10 | | -This template serves three distinct use cases: |
| 11 | +The template generator enables you to create an: |
11 | 12 |
|
12 | | -* **Project Template**: Provides essential access to Isaac Sim and Isaac Lab's features, making it ideal for projects |
13 | | - that require a standalone environment. |
14 | | -* **Python Package**: Facilitates integration with Isaac Sim's native or virtual Python environment, allowing for |
15 | | - the creation of Python packages that can be shared and reused across multiple projects. |
16 | | -* **Omniverse Extension**: Supports direct integration into Omniverse extension workflow. |
| 13 | +* **External project** (recommended): An isolated project that is not part of the Isaac Lab repository. This approach |
| 14 | + works outside of the core Isaac Lab repository, ensuring that your development efforts remain self-contained. Also, |
| 15 | + it allows your code to be run as an extension in Omniverse. |
17 | 16 |
|
18 | | -.. note:: |
| 17 | + .. hint:: |
| 18 | + |
| 19 | + For the external project, the template generator will initialize a new Git repository in the specified directory. |
| 20 | + You can push the generated content to your own remote repository (e.g. GitHub) and share it with others. |
| 21 | + |
| 22 | +* **Internal task**: A task that is part of the Isaac Lab repository. This approach should only be used to create |
| 23 | + new tasks within the Isaac Lab repository in order to contribute to it. |
| 24 | + |
| 25 | +Running the template generator |
| 26 | +------------------------------ |
| 27 | + |
| 28 | +Install Isaac Lab by following the `installation guide <../../setup/installation/index.html>`_. |
| 29 | +We recommend using conda installation as it simplifies calling Python scripts from the terminal. |
| 30 | + |
| 31 | +Then, run the following command to generate a new external project or internal task: |
| 32 | + |
| 33 | +.. tab-set:: |
| 34 | + :sync-group: os |
| 35 | + |
| 36 | + .. tab-item:: :icon:`fa-brands fa-linux` Linux |
| 37 | + :sync: linux |
19 | 38 |
|
20 | | - We recommend using the extension template for new projects, as it provides a more streamlined and |
21 | | - efficient workflow. Additionally it ensures that your project remains up-to-date with the latest |
22 | | - features and improvements in Isaac Lab. |
| 39 | + .. code-block:: bash |
23 | 40 |
|
| 41 | + ./isaaclab.sh --new # or "./isaaclab.sh -n" |
24 | 42 |
|
25 | | -Installation |
26 | | ------------- |
| 43 | + .. tab-item:: :icon:`fa-brands fa-windows` Windows |
| 44 | + :sync: windows |
27 | 45 |
|
28 | | -Install Isaac Lab by following the `installation guide <../../setup/installation/index.html>`_. We recommend using the conda installation as it simplifies calling Python scripts from the terminal. |
| 46 | + .. code-block:: batch |
| 47 | +
|
| 48 | + isaaclab.bat --new :: or "isaaclab.bat -n" |
| 49 | +
|
| 50 | +The generator will guide you in setting up the project/task for your needs by asking you the following questions: |
| 51 | + |
| 52 | +* Type of project/task (external or internal), and project/task path or names according to the selected type. |
| 53 | +* Isaac Lab workflows (see :ref:`feature-workflows`). |
| 54 | +* Reinforcement learning libraries (see :ref:`rl-frameworks`), and algorithms (if the selected libraries support multiple algorithms). |
| 55 | + |
| 56 | +External project usage (once generated) |
| 57 | +--------------------------------------- |
| 58 | + |
| 59 | +Once the external project is generated, a ``README.md`` file will be created in the specified directory. |
| 60 | +This file will contain instructions on how to install the project and run the tasks. |
| 61 | + |
| 62 | +Here are some general commands to get started with it: |
| 63 | + |
| 64 | +.. note:: |
29 | 65 |
|
30 | | -Clone the extension template repository separately from the Isaac Lab installation (i.e. outside the IsaacLab directory): |
| 66 | + If Isaac Lab is not installed in a conda environment or in a (virtual) Python environment, use ``FULL_PATH_TO_ISAACLAB/isaaclab.sh -p`` |
| 67 | + (or ``FULL_PATH_TO_ISAACLAB\isaaclab.bat -p`` on Windows) instead of ``python`` to run the commands below. |
31 | 68 |
|
32 | | -.. code:: bash |
| 69 | +* Install the project (in editable mode). |
33 | 70 |
|
34 | | - # Option 1: HTTPS |
35 | | - git clone https://github.com/isaac-sim/IsaacLabExtensionTemplate.git |
| 71 | + .. code:: bash |
36 | 72 |
|
37 | | - # Option 2: SSH |
38 | | - git clone [email protected]:isaac-sim/IsaacLabExtensionTemplate.git |
| 73 | + python -m pip install -e source/<given-project-name> |
39 | 74 |
|
40 | | -Throughout the repository, the name ``ext_template`` only serves as an example and we provide a script to rename all the references to it automatically: |
| 75 | +* List the tasks available in the project. |
41 | 76 |
|
42 | | -.. code:: bash |
| 77 | + .. warning:: |
43 | 78 |
|
44 | | - # Enter the repository |
45 | | - cd IsaacLabExtensionTemplate |
| 79 | + If the task names change, it may be necessary to update the search pattern ``"Template-"`` |
| 80 | + (in the ``scripts/list_envs.py`` file) so that they can be listed. |
46 | 81 |
|
47 | | - # Rename all occurrences of ext_template (in files/directories) to your_fancy_extension_name |
48 | | - python scripts/rename_template.py your_fancy_extension_name |
| 82 | + .. code:: bash |
49 | 83 |
|
50 | | -Using a python interpreter that has Isaac Lab installed, install the library: |
| 84 | + python scripts/list_envs.py |
51 | 85 |
|
52 | | -.. code:: bash |
| 86 | +* Run a task. |
53 | 87 |
|
54 | | - python -m pip install -e source/ext_template |
| 88 | + .. code:: bash |
55 | 89 |
|
| 90 | + python scripts/<specific-rl-library>/train.py --task=<Task-Name> |
56 | 91 |
|
57 | | -For more details, please follow the instructions in the `extension template repository <https://github.com/isaac-sim/IsaacLabExtensionTemplate>`_. |
| 92 | +For more details, please follow the instructions in the generated project's ``README.md`` file. |
0 commit comments