目录

Humanoid Sim

基于 Isaac Lab 的人形机器人步态强化学习训练框架,从 Humanoid-Gym 移植而来。

机器人:XBot-L(1.65m 人形机器人,12 DOF 腿部关节)
算法:PPO(Proximal Policy Optimization)
目标:零样本 Sim2Real 步态迁移
框架:Isaac Lab(兼容 Isaac Sim 4.5.0 / 5.0.0 / 5.1.0)

📄 论文Humanoid-Gym: Reinforcement Learning for Humanoid Robot with Zero-Shot Sim2Real Transfer (arXiv:2404.05695)


快速开始

环境要求

  • Ubuntu 22.04+
  • NVIDIA GPU(显存 ≥ 16GB 推荐)
  • NVIDIA Driver ≥ 525
  • Isaac Sim 4.5.0 / 5.0.0 / 5.1.0
  • Isaac Lab
  • Python ≥ 3.10

安装

# 1. 安装 Isaac Lab(参考官方文档)
# https://isaac-sim.github.io/IsaacLab/main/source/setup/installation/index.html

# 2. 安装本扩展
cd humanoid_sim
pip install -e source/humanoid_sim

# 3. 验证安装
python scripts/list_envs.py

使用方法

训练

# 基础训练(4096 环境,3001 轮迭代)
python scripts/rsl_rl/train.py --task Isaac-Humanoid-Sim-Direct-v0 --num_envs 4096 --headless

# 自定义轮数
python scripts/rsl_rl/train.py --task Isaac-Humanoid-Sim-Direct-v0 --max_iterations 5001 --headless

# 从 checkpoint 恢复
python scripts/rsl_rl/train.py --task Isaac-Humanoid-Sim-Direct-v0 --headless --resume True --load_run <训练目录名>

# TensorBoard 监控
tensorboard --logdir logs/rsl_rl/humanoid_sim_ppo --port 6006

评估

# 运行最新 checkpoint
python scripts/rsl_rl/play.py --task Isaac-Humanoid-Sim-Direct-v0 --headless

# 指定 checkpoint + 录制视频
python scripts/rsl_rl/play.py --task Isaac-Humanoid-Sim-Direct-v0 \
    --checkpoint logs/rsl_rl/humanoid_sim_ppo/<时间戳>/model_3000.pt \
    --video --video_length 500

快速测试

python scripts/test_env.py      # 环境创建 + 单步运行
python scripts/random_agent.py  # 随机动作测试
python scripts/zero_agent.py    # 零动作测试

工程结构

humanoid_sim/
├── CLAUDE.md                             # 开发者参考文档(参数对照、移植约束)
├── README.md                             # 本文件
├── scripts/                              # 入口脚本
│   └── rsl_rl/
│       ├── train.py                      # PPO 训练入口
│       └── play.py                       # 策略评估 / 模型导出
├── source/humanoid_sim/                  # Isaac Lab 扩展包
│   └── humanoid_sim/
│       ├── tasks/direct/humanoid_sim/
│       │   ├── humanoid_sim_env.py       # 环境实现(核心:PD控制、步态、22项奖励)
│       │   ├── humanoid_sim_env_cfg.py   # 环境参数配置
│       │   └── agents/
│       │       └── rsl_rl_ppo_cfg.py     # PPO 超参数
│       └── assets/robots/                # 机器人模型
│           ├── urdf/XBot-L.urdf          # URDF 模型 (5152 行)
│           ├── mjcf/XBot-L.xml           # MuJoCo 模型
│           └── meshes/                   # STL 网格文件
├── logs/                                 # 训练产物
│   └── rsl_rl/humanoid_sim_ppo/         # PPO checkpoint + TensorBoard
└── outputs/                              # Hydra 运行日志

关键参数

参数 说明
并行环境数 4096 num_envs
Episode 长度 24 秒 episode_length_s
仿真频率 1000 Hz sim.dt = 0.001
控制频率 100 Hz decimation = 10
步态周期 0.64 秒 cycle_time
动作空间 12 维 腿部关节位置偏移
Actor 观测 705 维 15 帧 × 47 维
奖励函数 22 项 详见 CLAUDE.md

依赖

  • Isaac Lab — 核心仿真框架 (isaaclab, isaaclab_assets, isaaclab_rl, isaaclab_tasks)
  • RSL-RL — PPO 算法实现 (≥ 3.0.1)
  • Isaac Sim — 物理引擎 (4.5.0 / 5.0.0 / 5.1.0)
  • PyTorch — GPU 张量计算
  • psutil — 系统资源监控

许可证

BSD-3-Clause. 本项目部分代码源自 Humanoid-Gym


参考

关于
4.7 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号