07GenieSim配置
Genie Sim 是 AgiBot 推出的仿真框架,为开发者提供高效的数据生成能力和评估基准,以加速具身智能的开发。Genie Sim 建立了一个全面的闭环流程,包括轨迹生成、模型训练、基准测试和部署验证。用户可以通过这个高效的仿真工具链快速验证算法性能并优化模型。无论是简单的抓取任务还是复杂的远程操作,Genie Sim 都能提供高度逼真的仿真环境和精确的评估指标,助力开发者高效完成机器人技术的开发和迭代。
Genie Sim Benchmark 作为 Genie Sim 的开源评估版本,致力于为具身 AI 模型提供精确的性能测试和优化支持。
可以最开始先下载资产
代码块
Bash
sudo apt install git-lfsgit lfs install# When prompted for a password, use an access token with write permissions.# Generate one from your settings: https://huggingface.co/settings/tokensgit clone https://huggingface.co/datasets/agibot-world/GenieSimAssets
代码块
Bash
# Configure the repositorycurl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ && \ sudo apt-get update# Install the NVIDIA Container Toolkit packagessudo apt-get install -y nvidia-container-toolkitsudo systemctl restart docker# Configure the container runtimesudo nvidia-ctk runtime configure --runtime=dockersudo systemctl restart docker# Verify NVIDIA Container Toolkitdocker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
https://docs.isaacsim.omniverse.nvidia.com/latest/installation/requirements.html
请访问 https://huggingface.co/datasets/agibot-world/GenieSimAssets 并按照说明操作。
使用 Docker 容器进行开发
◦
按照 Isaac Sim 文档 安装 Docker
准备 Docker 镜像
代码块
Bash
代码块
Plain Text
# 进入 genie_sim 根目录并从 Dockerfile 创建 Docker 镜像docker build -f ./scripts/dockerfile -t registry.agibot.com/genie-sim/open_source:latest .
如果遇到网络问题,我的方法是:
代码块
Bash
ip addr show docker0 | grep "inet\s" | awk '{print $2}' | cut -d/ -f1DOCKER_HOST_IP="172.17.0.1" docker build \ --add-host=host.docker.internal:"$DOCKER_HOST_IP" \ --build-arg http_proxy="http://host.docker.internal:7890" \ --build-arg https_proxy="http://host.docker.internal:7890" \ --build-arg no_proxy="localhost,127.0.0.1" \ -f ./scripts/dockerfile \ -t registry.agibot.com/genie-sim/open_source:latest .
•
运行 Docker 容器并启动服务器
代码块
Bash
# 在主目录中启动一个新容器# 你需要将 /assets 更改为 GenieSimAssets 文件夹SIM_ASSETS=/17robo/GenieSimAssets/ ./scripts/start_gui.sh./scripts/into.sh# 启动服务器omni_python server/source/genie.sim.lab/raise_standalone_sim.py --enable_curobo True # 此演示的抓取轨迹由 Curobo 生成

App ready之后再执行下一句
然后我们就看到,如果超市演示执行完成,就会这边的仿真器也退出。
代码块
Bash
# start container in main directory./scripts/into.sh# start client in containeromni_python benchmark/task_benchmark.py --task_name=curobo_restock_supermarket_items --env_class=DemoEnvomni_python benchmark/task_benchmark.py --task_name=iros_open_drawer_and_store_items --env_class=DemoEnv (暂时有报错)omni_python benchmark/task_benchmark.py --task_name=genie_task_home_microwave_food --env_class=DemoEnv (这个也是用不了的,只有输出step)geniesim2.1和2.0一样只给了一个curobo跑任务的示例,开源部分只配置了上货任务,其他iros任务需要模型推理或者遥操作

先回出现这个绿色的info
然后等大概1min
如果遇到了gRPC相关的报错,请参考issue修改即可
https://github.com/AgibotTech/genie_sim/issues/11
注意命令行不能设置任何代理!同时sudo ufw allow 50051
代码块
Bash
make sure your server is running (launched by omni_python server/source/genie.sim.lab/raise_standalone_sim.py --enable_curobo True in same container)make sure your port 50051 is not be used. You must kill other process on 50051 by sudo lsof -i :50051 and sudo kill -9 .


我这里遇到了卡在这里的问题

从远程pull一下最新代码。

就不会卡住。
同时,如果有对应大文件更改,可以到assets下面:
git lfs pull # 确保所有LFS文件是最新的
https://github.com/AgibotTech/genie_sim/issues/29
我们建议开发者使用我们统一的 Docker 容器环境。
如果希望使用自己的环境,请参考我们提供的 dockerfile 并安装我们列出的依赖项。
安装并设置 pre-commit 以启用自动文件格式化程序,适用于 Python / JSON / YAML 等。
代码块
Bash
# 将 pre-commit 安装到你的 Python 环境sudo apt install python3-pippip3 install pre-commit# 在仓库中启用预定义的 pre-commit 钩子pre-commit install
对所有跟踪的文件触文件格式化程序
代码块
Bash
pre-commit run --all-files
2.4 基准测试任务#### 2.4.1 运行基准测试1. 运行 docker 容器
代码块
Plain Text
# 在主目录中启动一个新容器# 需要将 /assets 更改为 GenieSimAssets 文件夹SIM_ASSETS=/17robot/GenieSimAssets ./scripts/start_gui.sh
运行基准测试
在 docker 容器外的 genie_sim 根目录下执行以下命令
Auto run是挺好用的。不过需要infer参数
代码块
Plain Text
./scripts/autorun.sh genie_task_home_pour_water infer
https://github.com/AgibotTech/genie_sim/issues/34
支持以下任务名称
任务名称
genie_task_cafe_espresso
genie_task_cafe_toast
genie_task_home_clean_desktop
genie_task_home_collect_toy
genie_task_home_microwave_food
genie_task_home_open_drawer
genie_task_home_pass_water
genie_task_home_pour_water
genie_task_home_wipe_dirt
genie_task_supermarket_cashier_packing
genie_task_supermarket_stock_shelf
genie_task_supermarket_pack_fruit
配置
使用 ADER (Action Domain Evaluation Rule) 进行评估配置
示例
JSON
代码块
Plain Text
当前评估能力
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
评估输出数据结构
JSON
代码块
Plain Text
//输出[ { "task_type": "benchmark", "model_path": "", "task_uid": "13513cf3-2d88-421e-b3e5-dc0998a60970", "task_name": "genie_task_supermarket", "stage": "", "result": { "code": -1, "step": 0, "msg": "", "progress": [], "scores":[] }, "start_time": "2025-06-05 15:04:31", "end_time": "2025-06-05 15:05:40" }]
错误码
Python
代码块
Plain Text
from enum import Enumclass ErrorCode(Enum): INIT_VALUE = -1 SUCCESS = 0 ABNORMAL_INTERRUPTION = 1 OUT_OF_MAX_STEP = 2 UNKNOWN_ERROR = 500
从以下地址下载 Agibot World 仓库和基线模型
a. GitHub - OpenDriveLab/AgiBot-World at manipulation-challenge
下载后,只要docker不更新build,之前的agibot-world还是在docker的main下的
代码块
Plain Text
# 初始化 Agibot World 仓库以运行基线模型git clone -b git submodule update --init --recursive
后面每次可以拉取一下更新:
代码块
TypeScript
root@ubuntu22:/workspace/main/AgiBot-World# lsexperiments InternVL __pycache__ scriptsgenie_sim_ros.py latent_action_model README.mdhubconf.py prismatic requirements.txtroot@ubuntu22:/workspace/main/AgiBot-World# git pullfatal: detected dubious ownership in repository at '/root/workspace/main/AgiBot-World'To add an exception for this directory, call: git config --global --add safe.directory /root/workspace/main/AgiBot-Worldroot@ubuntu22:~/workspace/main/AgiBot-World# 需要git config --global --add safe.directory /root/workspace/main/AgiBot-World然后git pullgit submodule update --init --recursive
FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/finetuned/action_decoder.pt'
There was an error running python
这个是因为需要添加基线模型
将所有基线模型文件和代码移动到 Agibot-World 目录下
代码块
Bash
cp -r UniVLA/latent_action_model/ ./latent_action_model/cp -r UniVLA/scripts/ ./scripts/cp -r UniVLA/prismatic/ ./prismatic/cp -r UniVLA/experiments/ ./experiments/mkdir -p checkpoints/finetunedcd checkpoints/finetunedgit lfs clone https://huggingface.co/qwbu/univla-iros-manipulation-challenge-baselinemv univla-iros-manipulation-challenge-baseline/* ./
为了保持最新
代码块
Bash
git clone -b manipulation-challenge https://github.com/OpenDriveLab/AgiBot-World.git AgiBot-World-manipulation-challengecp -r AgiBot-World-manipulation-challenge/UniVLA/* AgiBot-World/
代码块
Plain Text
main├── AgiBot-World│ ├── InternVL│ ├── experiments/robot│ ├── latent_action_model│ ├── prismatic│ ├── robot│ ├── scripts│ │ └── infer.py│ │ └── ...│ │ └── ...│ ├── checkpoints│ │ └── finetuned│ │ └── readme.txt│ ├── genie_sim_ros.py│ ├── hubconf.py│ └── requirements.txt
有个需要修改的地方infer.py的第五行:
后续有空我提个PR,也欢迎有空的小伙伴去提(目前该问题已修复,不用管这个了)
运行 docker 容器
代码块
Plain Text
# 在主目录中启动一个新容器# 需要将 /assets 更改为本地 assets 文件夹SIM_ASSETS=/17robo/GenieSimAssets ./scripts/start_gui.sh
运行基线模型推理
在 docker 容器外的 genie_sim 根目录下执行以下命令
代码块
Plain Text
./scripts/autorun.sh iros_open_drawer_and_store_items infer./scripts/autorun.sh iros_clear_the_countertop_waste infer
支持以下任务名称
|
|
|
|
|
|
|
|
|
|
|
|
成功咯,24G显卡够用
打开抽屉并夹取物体,不过过程还是有很多问题的哈哈哈,最后把魔方搞到地上了
根据以下说明构建自己的代码
a. 使用以下路径的模板开始模型集成。不要修改 infer 函数的结构。
代码块
Plain Text
b. 在自定义时,请确保 ROS 节点严格遵守指定的话题
*模型推理与仿真环境之间的通信是标准化的,并基于 ROS2 实现。这些是为任务指定的专用话题。
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
c. 自定义后,请确认文件组织结构与指定布局匹配,并确保包含 infer.py 和 genie_sim_ros.py。
代码块
Plain Text
main├── AgiBot-World│ ├── scripts│ │ └── infer.py│ │ └── ...│ │ └── ...│ ├──genie_sim_ros.py│ ├──...│ └──...
运行 docker 容器
Bash
代码块
Plain Text
# 需要将 /assets 更改为 GenieSimAssets 文件夹SIM_ASSETS=/assets ./scripts/start_gui.sh
运行模型推理
在 docker 容器外的 genie_sim 根目录下执行以下命令
代码块
Plain Text
./scripts/autorun.sh {TASK_NAME} infer
模型推理依赖
常用的 Python 库已在 Genie Sim Benchmark 仓库的 requirements.txt 文件中列出,并预装在我们的操作测试服务器的 docker 镜像中。如果需要额外的 Python 库来运行策略,可以在测试服务器上随模型文件一起上传一个包含额外库的 requirements.txt 文件。
请参考 2.4.2 基准评估框架
支持使用手柄控制机器人腰部、头部、左/右末端执行器和基座的移动。
用户指南
| |
| |
| |
| |
| |
| |
| |
| |
Pico 设置
连接到与计算机相同的局域网
在资源库中启动 AIDEA Vision App
选择无线连接并输入计算机的 IP 地址
启动设置
启动服务器
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python server/source/genie.sim.lab/raise_standalone_sim.py
在容器中启动 PICO 控制
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python teleop/teleop.py --task_name genie_task_home_microwave_food --mode pico --host_ip x.x.x.x
支持键盘控制机器人腰部、头部、左/右末端执行器和基座的移动。
用户指南
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
启动设置
启动服务器
Bash
代码块
Plain Text
SIM_ASSETS=~/17robo/GenieSimAssets/ ./scripts/start_gui.sh./scripts/into.sh# 在容器内运行此命令omni_python server/source/genie.sim.lab/raise_standalone_sim.py
在容器中启动键盘控制
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python teleop/teleop.py --task_name genie_task_home_microwave_food --mode "keyboard"
腰部的还是慎用,感觉没弄好,整体来说末端执行器控制还是很棒的
这里再备注一下任务:
genie_task_cafe_espresso
genie_task_cafe_toast
genie_task_home_clean_desktop
genie_task_home_collect_toy
genie_task_home_microwave_food
genie_task_home_open_drawer
genie_task_home_pass_water
genie_task_home_pour_water
genie_task_home_wipe_dirt
genie_task_supermarket_cashier_packing
genie_task_supermarket_stock_shelf
genie_task_supermarket_pack_fruit
为提高效率,首先记录轨迹,然后执行回放来录制视频。
将所有场景信息(包括机器人关节位置、物体姿态、相机姿态等)记录在 state.json 文件中。
•
启动服务器
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python server/source/genie.sim.lab/raise_standalone_sim.py
•
启动客户端
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python teleop/teleop.py --task_name genie_task_home_pour_water --mode keyboard --record
场景信息记录在 ./output/recording_data/{TASK_NAME}/state.json
这里生成的 /root/workspace/main/output/recording_data/genie_task_home_pour_water/state.json
回放轨迹并录制视频。
•
启动服务器
Bash
代码块
Plain Text
# 在容器内运行此命令omni_python server/source/genie.sim.lab/raise_standalone_sim.py --disable_physics --record_img --record_video
•
启动客户端
Bash
代码块
Plain Text
# 例如:TASK_NAME=genie_task_home_pour_water# 在容器内运行此命令omni_python teleop/replay_state.py --task_file teleop/tasks/${TASK_NAME}.json --state_file output/recording_data/${TASK_NAME}/state.json --record
图像和视频记录在 ./output/recording_data/{TASK_NAME}/{IDX}/
运行 docker 容器
Bash
代码块
Plain Text
在 docker 容器外的 genie_sim 根目录下执行 shell 脚本
a. 运行任务布局
Bash
代码块
Plain Text
./scripts/autorun.sh {TASK_NAME}
b. 运行 PICO 遥操作
Bash
代码块
Plain Text
c. 运行键盘遥操作
Bash
代码块
Plain Text
./scripts/autorun.sh {TASK_NAME} keyboard
d. 运行场景回放
Bash
代码块
Plain Text
./scripts/autorun.sh {TASK_NAME} replay {STATE_FILE_PATH}
e. 运行模型推理
Bash
代码块
Plain Text
./scripts/autorun.sh {TASK_NAME} infer
f. 运行清理
Bash
代码块
Plain Text
./scripts/autorun.sh clean
在终端中按 q 或 Q 键以正常停止任务。autorun 脚本默认启用 ros topic 记录。如果不需要,请在 autorun 脚本中删除相关代码,并确保定期清理输出文件夹。(存储哪些信息呢?保存到哪里呢)
每个基准任务文件都包含以下 6 个关键元素:
task 包含一个唯一的任务名称
objects 包含多种任务对象:
a.
extra_objects: 非交互式对象
b.
fix_objects: 具有固定初始姿态的交互式对象
c.
task_related_objects: 具有随机初始姿态的交互式对象
recording_setting 指定要录制的相机视角
robot 包括机器人 ID、机器人配置文件和机器人基座初始姿态
scene 指定一组场景信息:
a.
scene_id: 场景的唯一名称
b.
function_space_objects: 随机生成 task_related_objects 的立方体区域
c.
scene_info_dir: 场景资产的路径
d.
scene_usd: 场景 usd 文件的路径
stages 包含为规划任务设计的几个子阶段
首先,组装任务模板,如 "genie_task_supermarket.json"。此配置文件包含机器人、场景、对象和阶段等。
代码块
Plain Text
benchmark/bddl/eval_tasks/your_task.json
请正确填写资产文件路径。程序将在用户配置的环境变量 SIM_ASSETS 中查找资产。
场景泛化:将任务与场景进行映射
代码块
Plain Text
文件路径: benchmark/bddl/task_to_preselected_scenes.json
JSON
代码块
Plain Text
{ "genie_task_supermarket": [ "scenes/genie/supermarket_02/Collected_emptyScene_01/emptyScene_01.usd" ]}
编写评估标准代码,例如
代码块
Plain Text
文件路径: benchmark/bddl/task_definitions/genie_task_supermarket/problem0.bddl
Lisp
代码块
Plain Text
(define (problem restock_shelves) (:domain isaac) (:objects benchmark_beverage_bottle_013 - bottle.n.01 ) (:init (onfloor benchmark_beverage_bottle_013 floor.n.01_2) ) (:goal (onshelf ?benchmark_beverage_bottle_013) ))
现在,基准配置步骤已完成。
在 "yourpolicy.py" 中访问具身智能模型。(请参考 demopolicy.py)
Python
代码块
Plain Text
class YourPolicy(BasePolicy):def __init__(self) -> None:super().__init__() """初始化配置并加载模型。"""passdef reset(self):"""重置。"""passdef act(self, observations, **kwargs) -> np.ndarray:"""根据观察结果采取行动。 参数: observations 包含机器人图像 (Head_Camera_01/Right_Camera_01/Left_Camera_01) 和当前关节信息 返回: 机器人目标关节 """pass
最后,运行客户端并评估自己的 AI 模型
Bash
代码块
Plain Text
python3 benchmark/task_benchmark.py --task_name {task name} --policy_class {policy name} --env_class OmniEnv
按照说明启用碰撞体调试模式
•
复杂的网格会导致碰撞计算错误,越简单越好
•
在小区域内有太多的三角网格通常会导致网格碰撞
convexHull 和 convexDecompisition
良好意味着易于抓取且网格碰撞少
•
良好的碰撞网格通常看起来简单整洁
•
确保抓取的关键区域恰到好处(例如罐头、瓶子、瓶盖)
convexDecompisition 网格
convexDecompisition 碰撞体
convexHull
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |