Author: Shiyuan Yang
Email: [email protected]
This tutorial is about how to train a quadruped RL policy by Isaac Lab, and how to export .pt file which can be used in Isaac Sim.
-
Activate the Isaac Lab environment:
conda activate isaaclab
-
Navigate to the Isaac Lab directory:
cd <path_to_isaac_lab>
-
Run the desired task command:
./isaaclab.sh <your task command>
-
Example command to train a model:
./isaaclab.sh -p source/standalone/workflows/rsl_rl/train.py --task Isaac-Velocity-Flat-Unitree-Go2-v0 --num_envs 4096 --headless --video --enable_cameras
-
After training, run the following command to play the trained model:
./isaaclab.sh -p source/standalone/workflows/rsl_rl/play.py --task Isaac-Velocity-Flat-Unitree-Go2-v0 --num_envs 4096
This will play the trained model, allowing you to see its performance. It will also export the checkpoint file to a model file.
Note: The checkpoint file does not contain
constant.pkl
, which is used to temporarily store training status. For more details, see this blog. -
After playing and exporting, navigate to:
/home/ubuntu-user/robot_repo/shiyuan_ws/IsaacLab/logs/rsl_rl/unitree_go2_flat/2024-12-30_13-55-59/exported
There should be
.pt
and.onnx
files as the final model files.
When running the following command:
./isaaclab.sh -p source/standalone/workflows/rsl_rl/train.py --task Isaac-Velocity-Flat-Spot-v0 --num_envs 4096 --headless --video --enable_cameras
You might encounter the following error:
omegaconf.errors.UnsupportedValueType: Value 'Tensor' is not a supported primitive type
full_key: env.scene.robot.actuators.spot_knee.joint_parameter_lookup
object_type=dict
Re-installing Isaac Lab v1.3.0 (GitHub - isaac-sim/IsaacLab at v1.3.0) instead of the master branch resolved the issue, indicating a potential issue between versions 1.3.0 and the master branch.