This repo provides a custom task to be used with Isaac Gym as well as scripts for training and exporting models.
- Nvidia GPU with 470+ drivers (
nvidia-smito make sure these are set up) - Isaac Gym (tested with version
1.0.preview3) - IsaacGymEnvs (tested with commit
9656bac7e59b96382d2c5040b90d2ea5c227d56d)
- Download Isaac Gym from Nvidia’s developer portal:
https://developer.nvidia.com/isaac-gym cd isaacgym/python && pip install -e .to install Python package- More detailed installation guide in:
isaacgym/docs/install.html
git clone https://github.com/NVIDIA-Omniverse/IsaacGymEnvs(tested with commit9656bac7e59b96382d2c5040b90d2ea5c227d56d)cd IsaacGymEnvs && pip install -e .to install Python package
train.py: Main script used for training/testing modelsexport.py: Script for exporting models as ONNX filescfg/task/: YAML configs for each task defining environment parameters and domain randomizationcfg/train/: YAML configs for each task defining RL model and hyperparameterstasks/: Class definitions and assets for each taskruns/: Model checkpoints and summaries will be saved here
Create a new folder called tasks/{task_name}. The following files will be needed:
tasks/{task_name}/{task_name}.py: Class defining the task. Rewards, observations, actions are all defined here.tasks/{task_name}/assets/: URDF and meshes should be placed here.cfg/task/{TaskName}.yaml: Config file defining environment parameters and domain randomizationcfg/train/{TaskName}PPO.yaml: Config gile defining hyperparameters for training
python train.py task={task_name}to begin training- Models are saved as
runs/{TaskName}/nn/{checkpoint_name}.pth
python export.py task={task_name} checkpoint="runs/{TaskName}/nn/{checkpoint_name}.pth"to export- Model is exported to
runs/{TaskName}/nn/{checkpoint_name}.pth.onnx
This repo was designed to be used after installing IsaacGymEnvs (https://github.com/NVIDIA-Omniverse/IsaacGymEnvs) as a Python library.
IsaacGymEnvs comes close to being usable as a library, but requires adding your custom task to a map.
The following files are taken from IsaacGymEnvs and modified so that this isn't necessary:
cfg/config.yaml(minimal changes)utils/rlgames_utils.py(minimal changes)base/vec_task.py(minimal changes)train.py
Instead of looking for tasks in a static map, this code uses pydoc.locate to dynamically load the task class.