This project is the first implementation of a co-design framework for the discovery of mechanisms and controllers through isaac lab.
Instructions for installation.
TODO: Add the instructions from Isaac lab here
Example:
sudo apt install cmake build-essential
./isaaclab.sh --install # or "./isaaclab.sh -i"If you use the jax framework make sure to run the following to get all the dependencies:
pip install --upgrade "jax[cuda12]"
pip install skrl["all"]To train an environments:
./isaaclab.sh -p scripts/run.py \
--task Isaac-Pendulum-Simple-Direct-v0 \
--num_envs 100 \
--ml_framework jax \
--mode train \
--algorithm *Controller \
--duration 3.0 \
--max_rollouts 100 \
--headlessTo visualize some test data:
./isaaclab.sh -p scripts/run.py \
--task Isaac-Pendulum-Simple-Direct-v0 \
--num_envs 1 \
--ml_framework jax \
--mode test \
--algorithm *Controller \
--duration 3.0 \
--max_rollouts 10 \
--recordTo see the flags you can use for the run.py run ./isaaclab.sh -p scripts/run.py --help
- To create an environment, a .usd file must be created from a .urdf
- The .usd files from this project are to be found at
source/isaaclab_assets/isaaclab_assets/custom. The .py files set up the simulation. - The task definitions (RL-problem) are defined in
source/isaaclab_tasks/isaaclab_tasks. Inside there are the managed tasks and the direct tasks. Managed tasks use higher level abstractions that reduce the difficulty while direct tasks allow granular control. - For now, all the environments are being run as managed tasks
Run to train pendulum environment:
./isaaclab.sh -p scripts/effort_calcs/run.py --task Isaac-Pendulum-v0 --num_envs 64 --ml_framework jax
--controller 'rl' --headless --mode trainRun to record some data on the logs:
./isaaclab.sh -p scripts/effort_calcs/run.py --task Isaac-Pendulum-v0 --num_envs 1 --ml_framework jax --mode test
--controller pid --record --duration 1.0 --max_runtime_iterations 1000 --headlessRun to visualize the firs episode of the latest test:
./isaaclab.sh -p ./scripts/effort_calcs/visualize.py --task Isaac-Pendulum-v0 --ml_framework jaxIf you need to setup wandb again:
export WANDB_API_KEY=3a8c037b3fd5bda9fb344d61686b81afc661b0cc
pip install wandb
wandb loginIf you want to debug in pycharm, create a conditional in the script like this and also create a run configuration of "Python Debugger" with the code mappings pointing at the root folder:
# Handle debugger connection
if args_cli.debugger:
import pydevd_pycharm
pydevd_pycharm.settrace(
host="localhost",
port=5678,
stdoutToServer=True,
stderrToServer=True, # Optional: waits for debugger to attach before running
)If the isaac sim warning that is stuck persists, run:
gsettings set org.gnome.mutter check-alive-timeout 10000If you run out of GPU memory while using both isaac AND jax on it, then allow dynamic memory allocation to the start of your script:
# this is required to be able to run both sim and learning in cpu
os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"] = "false"
os.environ["XLA_PYTHON_CLIENT_ALLOCATOR"] = "platform"