Adding your own learning library
Isaac Lab comes pre-integrated with a number of libraries (such as RSL-RL, RL-Games, SKRL, Stable Baselines, etc.). However, you may want to integrate your own library with Isaac Lab or use a different version of the libraries than the one installed by Isaac Lab. This is possible as long as the library is available as Python package that supports the Python version used by the underlying simulator. For instance, if you are using Isaac Sim 6.0.0 onwards, you need to ensure that the library is available for Python 3.12.
Using a different version of a library
If you want to use a different version of a library than the one installed by Isaac Lab, you can install the library by building it from source or using a different version of the library available on PyPI.
For instance, if you want to use your own modified version of the rsl-rl library, you can follow these steps:
- Follow the instructions for installing Isaac Lab. This will install the default version of the
rsl-rllibrary. - Clone the
rsl-rllibrary from the GitHub repository:
- Install the library in your Python environment:
In this case, the rsl-rl library will be installed in the Python environment used by Isaac Lab. You can now use the
rsl-rl library in your experiments. To check the library version and other details, you can use the following
command:
This should now show the location of the rsl-rl library as the directory where you cloned the library.
For instance, if you cloned the library to /home/user/git/rsl_rl, the output of the above command should be:
Integrating a new library
Adding a new library to Isaac Lab is similar to using a different version of a library. You can install the library in your Python environment and use it in your experiments. However, if you want to integrate the library with Isaac Lab, you will first need to make a wrapper for the library, as explained in Wrapping environments.
The following steps can be followed to integrate a new library with Isaac Lab:
- Add your library as an extra-dependency in the
setup.pyfor the extensionisaaclab_rl. This will ensure that the library is installed when you install Isaac Lab or it will complain if the library is not installed or available. - Install your library in the Python environment used by Isaac Lab. You can do this by following the steps mentioned in the previous section.
- Create a wrapper for the library. You can check the module
isaaclab_rlfor examples of wrappers for different libraries. You can create a new wrapper for your library and add it to the module. You can also create a new module for the wrapper if you prefer. - Create workflow scripts for your library to train and evaluate agents. You can check the existing workflow scripts
in the
scripts/reinforcement_learningdirectory for examples. You can create new workflow scripts for your library and add them to the directory.
Optionally, you can also add some tests and documentation for the wrapper. This will help ensure that the wrapper works as expected and can guide users on how to use the wrapper.
- Add some tests to ensure that the wrapper works as expected and remains compatible with the library.
These tests can be added to the
source/isaaclab_rl/testdirectory. - Add some documentation for the wrapper. You can add the API documentation to the
API documentation for the
isaaclab_rlmodule.
Configuring an RL Agent
Once you have integrated a new library with Isaac Lab, you can configure the example environment to use the new library. You can check the Configuring an RL Agent for an example of how to configure the training process to use a different library.