This directory contains all scripts for training, evaluation, and system management for the AGILE project.
Main training script for RL agents using RSL-RL. Supports distributed training, video recording, and W&B logging. Use this to train new policies from scratch or resume training from checkpoints.
Example usage:
python scripts/train.py --task Velocity-T1-v0 --num_envs 4096 --video --video_interval_iter 500 --headless --logger wandbEvaluation script for trained RL agents. Loads checkpoints, evaluates agent performance, and automatically exports policies to TorchScript and ONNX formats. Used for quantitative analysis, benchmarking, and policy export for deployment.
Example usage:
python scripts/eval.py --task Velocity-T1-v0 --num_envs 32 --checkpoint path/to/checkpoint.ptEnvironment validation script that runs environments with sinusoidal test actions (no policy required). Useful for debugging environment configurations, testing new robots, and validating MDP components.
Example usage:
python scripts/play.py --task Velocity-T1-v0 --num_envs 32Fallen State Validation Mode:
For tasks with pre-collected fallen states (e.g., StandUp-T1-v0), you can validate the collected dataset:
python scripts/play.py --task StandUp-T1-v0 --num_envs 16 --validate-fallen-statesThis loads the fallen state dataset and visualizes the collected poses with zero actions, resetting every 3 seconds to show different states. Useful for verifying the diversity and quality of collected fallen poses before training.
Evaluation script for Sim2Sim transfer to MuJoCo. Runs trained policies in MuJoCo simulation to verify transfer performance before real hardware deployment. This is a generic framework that works with any task by automatically parsing the I/O descriptor YAML file.
Example usage:
python scripts/sim2mujoco_eval.py --checkpoint path/to/policy.pt --config path/to/config.yaml --mjcf path/to/robot.xmlQuick Start Tutorial:
-
Export Policy to TorchScript:
python scripts/eval.py --task Velocity-G1-History-v0 --checkpoint path/to/checkpoint.pt # This automatically exports policy.pt in the checkpoint directory's exported/ folder -
Export I/O Descriptors:
python scripts/export_IODescriptors.py --task Velocity-G1-History-v0 --output_dir path/to/output # Generates a YAML file describing observation/action spaces -
Get Robot MJCF: We recommend using official robot models from Unitree's MuJoCo repository:
git clone https://github.com/unitreerobotics/unitree_mujoco.git # G1 robot: unitree_mujoco/unitree_robots/g1/g1_29dof.xml -
Run Sim2MuJoCo Evaluation:
python scripts/sim2mujoco_eval.py \ --checkpoint path/to/policy.pt \ --config path/to/config.yaml \ --mjcf unitree_mujoco/unitree_robots/g1/scene_29dof.xml \ --duration 10.0
💡 Interactive Control: The sim2mujoco module supports keyboard teleoperation. Use arrow keys (↑↓←→) or I/J/K/L for movement, U/O for turning, and Page Up/Down (or 9/0) for height control. Press SPACE to stop. Remove
--no-viewerflag to enable the interactive viewer.
Exports I/O descriptors from the environment configuration. Generates a yaml file describing observation and action spaces for the trained models. Can be used for deployment in isaac-deploy
Example usage:
python scripts/export_IODescriptors.py --task Velocity-T1-v0 --output_dir .Bash script to extract git repository information (commit hash, branch, uncommitted changes) before Docker builds for reproducibility tracking.
Shell scripts for environment setup and dependency management:
install_deps.sh- Install Python dependencies and configure Isaac Sim environmentinstall_deps_ci.sh- CI-specific dependency installation with optimizations for automated buildsinstall_deps_local.sh- Local development setup including additional developer toolssetup_hooks.sh- Configure git hooks for code quality checks (pre-commit, formatting)
Hyperparameter optimization using Weights & Biases:
init_sweep.py- Initialize new hyperparameter sweepsrun_sweep.py- Run sweep agents for distributed hyperparameter searchtrain_wrapper.py- Wrapper script that processes sweep parameterssweep.yaml- Sweep configuration defining parameter search spaces- See wandb_sweep/README.md for detailed usage instructions