Set up our reinforcement learning example repository: OmniIsaacGymEnvs
1.Install OmniIsaacGymEnvs for Isaac Sim
2.Run inferencing and training examples in OmniIsaacGymEnvs
3.Install OmniIsaacGymEnvs in Docker
4.Run OmniIsaacGymEnvs examples with LiveStream
Default Python Environment
Learn about Isaac Sim’s python environment and locate the python executable in Isaac Sim
Isaac Sim provides a built-in Python 3.10 environment that packages can use, similar to a system-level Python install
Recommended to use this Python environment when running the Python scripts
./python.sh path/to/script.py
Run the following from the Isaac Sim root folder to start a Python script in this environment
Workstation Installation
=> Already Done
(1)First clone the repository
git clone https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs.git
(2)Install the examples as a python module in Isaac Sim
(2)-1 Locate the Isaac Sim python executable, which by default should be python.sh on Linux or python.bat on Windows, located at the root of the Isaac Sim directory
cd ~/.local/share/ov/pkg/isaac_sim-*/
ls -l python.sh
pwd
(2)-2 Refer to the Isaac Sim python executable path as PYTHON_PATH
alias PYTHON_PATH=~/.local/share/ov/pkg/isaac_sim-*/python.sh
(2)-3 Add it to .bashrc
nano ~/.bashrc
alias PYTHON_PATH='~/.local/share/ov/pkg/isaac_sim-*/python.sh'
(2)-4 Install OmniIsaacGymEnvs to PYTHON_PATH by running the following from the root of OmniIsaacGymEnvs
cd OmniIsaacGymEnvs/
PYTHON_PATH -m pip install -e .
=> The following error may appear during the initial installation. This error is harmless and can be ignored
(2)-5 List of current environments in OmniIsaacGymEnvs:
What I intend to test
=> Anymal & AnymalTerrain
Example scripts should be launched from OmniIsaacGymEnvs/omniisaacgymenvs
Train your first policy
cd ~/OmniIsaacGymEnvs/omniisaacgymenvs
ls -l
PYTHON_PATH scripts/rlgames_train.py task=Cartpole
We will see an Isaac Sim window pop up
Once Isaac Sim initialization completes (which may take a few minutes if launching for the first time), the Cartpole scene will be constructed and simulation will start running automatically
The process will terminate once training finishes
The process will terminate once training finishes
Result
In the path /home/rosexpert1/OmniIsaacGymEnvs/omniisaacgymenvs/runs/, a Cartpole file is generated and the model with the best rewards is stored every 25, 50, 75, and 100 epochs
Anymal
Train your policy
cd ~/OmniIsaacGymEnvs/omniisaacgymenvs
PYTHON_PATH scripts/rlgames_train.py task=Anymal
We will see an Isaac Sim window pop up
Once Isaac Sim initialization completes (which may take a few minutes if launching for the first time), the Anymal scene will be constructed and simulation will start running automatically
Terminal
50 Epochs
79bdd6d86a)
100 Epochs
150 Epochs
200 Epochs
Checkpoint
250 Epochs & Checkpoint
300 Epochs
350 Epochs
400 Epochs
450 Epochs
500 Epochs
550 Epochs
600 Epochs
650 Epochs
700 Epochs
750 Epochs
800 Epochs
850 Epochs
900 Epochs
950 Epochs
1000 Epochs
Training Completed
Result
=> New Anymal file generated in the runs folder
=> Models generated per epochs is identified
Anymal Terrain
We will see an Isaac Sim window pop up
Once Isaac Sim initialization completes (which may take a few minutes if launching for the first time), the Anymal scene will be constructed and simulation will start running automatically
Terminal
50 Epochs
100 Epochs
Saving Checkpoint
150 Epochs
200 Epochs
250 Epochs
300 Epochs
350 Epochs
400 Epochs
450 Epochs
500 Epochs
550 Epochs
600 Epochs
650 Epochs
700 Epochs
750 Epochs
800 Epochs
850 Epochs
900 Epochs
950 Epochs
1000 Epochs
1050 Epochs
1100 Epochs
1150 Epochs
1200 Epochs
1250 Epochs
1300 Epochs
1350 Epochs
1400 Epochs
1450 Epochs
1500 Epochs
1550 Epochs
1600 Epochs
1650 Epochs
1700 Epochs
1750 Epochs
1800 Epochs
1850 Epochs
1900 Epochs
1950 Epochs
2000 Epochs
Training Completed
Result
cd ~/OmniIsaacGymEnvs/omniisaacgymenvs/runs/AnymalTerrain/nn/
ls -l
In the path /home/rosexpert1/OmniIsaacGymEnvs/omniisaacgymenvs/runs/, an AnymalTerrain file is generated and the model with the best rewards is stored every 25, 50, 75, and 100 epochs
cd ~/OmniIsaacGymEnvs/omniisaacgymenvs
PYTHON_PATH scripts/rlgames_train.py task=Cartpole test=True checkpoint=omniverse://localhost/NVIDIA/Assets/Isaac/2023.1.1/Isaac/Samples/OmniIsaacGymEnvs/Checkpoints/cartpole.pth
Error
Solution(Searching for it…)
https://forums.developer.nvidia.com/t/assistance-required-error-with-inferencing-using-pre-trained-checkpoints-in-isaac-gym/286386
Reference:
https://docs.omniverse.nvidia.com/isaacsim/latest/isaac_gym_tutorials/tutorial_gym_isaac_gym.html
https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs/blob/main/docs/examples/rl_examples.md#anymal-anymalpy