🤖 Galaxea 操作仿真器
提供仿真基准、专家演示流水线与基线策略,适用于 Galaxea R1 系列。用于收集高质量演示、转换为 LeRobot 数据集,并训练,评估扩散策略。
✨ 特性
- 覆盖 30+ 环境,17 类任务
- 兼容 LeRobot 数据集
- 基线 DP 训练与评估
安装
请参考 Galaxea DP安装后,继续按照下面步骤来安装才能完成使用各种工具
cd open-galaxea
conda activate opengalaxea
git clone https://github.com/huggingface/lerobot.git
cd lerobot
git checkout a5e0aae13a3efd0080ac7ab6b461980d644014ab
pip install -e .
export PYTHONPATH="your_lerobot_codebase_path:$PYTHONPATH" # 比如 export PYTHONPATH="/home/ubuntu/projects/open-galaxea/lerobot:$PYTHONPATH"
下载资产:
cd GalaxeaManipSim
gdown https://drive.google.com/file/d/1ZvtCv1H4FLrse_ElUWzsVDt8xRK4CyaC/
unzip robotwin_models.zip
mv robotwin_models galaxea_sim/assets/
若遇到 datasets 包缓存冲突,请清理 ~/.cache/huggingface/datasets。
🎮 采集演示
1) 生成原始演示(mplib)
下面展示三种不同任务的例子,以下示例命令行选其一运行。其中全部17种任务可以在open-galaxea/GalaxeaManipSim/galaxea_sim/envs/robotwin/__init__.py找到。
-
R1:
R1DualBottlesPickEasy -
R1 Pro:
R1ProBlocksStackEasy -
R1 Lite:
R1LiteBlocksStackEasy
python -m galaxea_sim.scripts.collect_demos --env-name R1DualBottlesPickEasy --num-demos 100
python -m galaxea_sim.scripts.collect_demos --env-name R1ProBlocksStackEasy --num-demos 100
python -m galaxea_sim.scripts.collect_demos --env-name R1LiteBlocksStackEasy --num-demos 100
默认 --obs_mode=state,数据保存在 datasets/<env-name>/collected。
2) 指定joint还是ik来回放数据,保存轨迹与图片
选择不同控制器来过滤无 IK 解的轨迹,并保存图像/深度至 datasets/<env-name>/replayed。
以下三条命令对应上面的三条指令
python -m galaxea_sim.scripts.replay_demos --env-name R1DualBottlesPickEasy --target_controller_type bimanual_joint_position --num-demos 100
python -m galaxea_sim.scripts.replay_demos --env-name R1ProBlocksStackEasy --target_controller_type bimanual_relaxed_ik --num-demos 100
python -m galaxea_sim.scripts.replay_demos --env-name R1LiteBlocksStackEasy --target_controller_type bimanual_joint_position --num-demos 100
🛠 训练策略
转换为 LeRobot 数据集
Galaxea DP 使用 convert_single_galaxea_sim_to_galaxea_lerobot(relaxed_ik 需加 --use_eef)。LeRobot DP 使用 convert_single_galaxea_sim_to_lerobot。这里数据默认会放在~/.cache/huggingface/lerobot/galaxea。
# LeRobot DP 示例
python -m galaxea_sim.scripts.convert_single_galaxea_sim_to_lerobot --task R1DualBottlesPickEasy --tag replayed --robot r1
python -m galaxea_sim.scripts.convert_single_galaxea_sim_to_lerobot --task R1ProBlocksStackEasy --tag replayed --robot r1_pro
python -m galaxea_sim.scripts.convert_single_galaxea_sim_to_lerobot --task R1LiteBlocksStackEasy --tag replayed --robot r1_lite
# 末端控制示例,加多 --use_eef
python -m galaxea_sim.scripts.convert_single_galaxea_sim_to_lerobot --robot r1_pro --task R1ProDualBottlesPickEasy --tag replayed --use_eef
python -m galaxea_sim.scripts.convert_single_galaxea_sim_to_lerobot --robot r1_pro --task R1ProBlocksStackEasy --tag replayed --use_eef
可选 --use_video 将图像存为视频,需安装 ffmpeg,必要时在 .../site-packages/lerobot/common/datasets/video_utils.py 中将 vcodec 改为 libx264。
训练
python -m galaxea_sim.scripts.train_lerobot_dp_policy --task R1DualBottlesPickEasy
python -m galaxea_sim.scripts.train_lerobot_dp_policy --task R1ProBlocksStackEasy
python -m galaxea_sim.scripts.train_lerobot_dp_policy --task R1LiteBlocksStackEasy
评估
python -m galaxea_sim.scripts.eval_lerobot_dp_policy --task R1DualBottlesPickEasy --pretrained-policy-path outputs/train/R1DualBottlesPickEasy/diffusion/.../checkpoint --target_controller_type bimanual_joint_position
python -m galaxea_sim.scripts.eval_lerobot_dp_policy --task R1ProBlocksStackEasy --pretrained-policy-path outputs/train/R1ProBlocksStackEasy/diffusion/.../checkpoint --target_controller_type bimanual_joint_position
python -m galaxea_sim.scripts.eval_lerobot_dp_policy --task R1LiteBlocksStackEasy --pretrained-policy-path outputs/train/R1LiteBlocksStackEasy/diffusion/.../checkpoint --target_controller_type bimanual_joint_position
结果展示
在open-galaxea/GalaxeaManipSim/outputs/train/R1DualBottlesPickEasy 应该能看到结果视频
许可与致谢
- MIT 许可
- 致谢 Diffusion Policy、LeRobot、Robotwin
引用
@inproceedings{GalaxeaManipSim,
title={Galaxea Manipulation Simulator},
author={Galaxea Team},
year={2025}
}