机械臂仿真/wm数据集介绍

发布时间:2026/7/7 11:25:55

机械臂仿真/wm数据集介绍 LIBERO是什么Lifelong Robot Learning 基准包含多个任务套件Spatial、Object、Goal 等高质量演示。 用途终身学习、知识迁移、基准测试。 下载LIBERO Datasets – LIBERO Box 链接或 Hugging FaceHuggingFaceVLA/libero 或 physical-intelligence/libero GitHubGitHub - Lifelong-Robot-Learning/LIBERO: Benchmarking Knowledge Transfer in Lifelong Robot Learning · GitHub 著名项目终身学习、Pi0 等模型基准。(define (problem LIBERO_Living_Room_Tabletop_Manipulation) (:domain robosuite) #基于 robosuiteMuJoCo 的机器人仿真框架。 (:language put both the alphabet soup and the tomato sauce in the basket) (:regions (basket_init_region #篮子应该放在桌子的哪 (:target living_room_table) (:ranges ( (-0.01 0.25 0.01 0.27) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (milk_init_region ##每种物品的初始放置范围x, y 坐标区间 (:target living_room_table) (:ranges ( (0.025 -0.125 0.07500000000000001 -0.07500000000000001) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (cream_cheese_init_region (:target living_room_table) (:ranges ( (0.07500000000000001 -0.225 0.125 -0.17500000000000002) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (orange_juice_init_region (:target living_room_table) (:ranges ( (-0.025 -0.275 0.025 -0.225) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (tomato_sauce_init_region (:target living_room_table) (:ranges ( (-0.125 0.025 -0.07500000000000001 0.07500000000000001) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (alphabet_soup_init_region (:target living_room_table) (:ranges ( (-0.125 -0.175 -0.07500000000000001 -0.125) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (butter_init_region (:target living_room_table) (:ranges ( (0.025 0.025 0.07500000000000001 0.07500000000000001) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (ketchup_init_region (:target living_room_table) (:ranges ( (-0.275 -0.175 -0.225 -0.125) ) ) (:yaw_rotation ( (0.0 0.0) ) ) ) (contain_region #篮子里面的“可容纳区域” (:target basket_1) ) ) (:fixtures living_room_table - living_room_table #定义了场景中的固定物体 ) (:objects #列出这个场景中所有出现的物体并指定它们的类型。 alphabet_soup_1 - alphabet_soup cream_cheese_1 - cream_cheese tomato_sauce_1 - tomato_sauce ketchup_1 - ketchup orange_juice_1 - orange_juice milk_1 - milk butter_1 - butter basket_1 - basket ) (:obj_of_interest #关键物体只有这三个物体是完成任务真正需要的 alphabet_soup_1 tomato_sauce_1 basket_1 ) (:init #定义任务开始时每个物体放在哪里。 (On alphabet_soup_1 living_room_table_alphabet_soup_init_region) (On cream_cheese_1 living_room_table_cream_cheese_init_region) (On tomato_sauce_1 living_room_table_tomato_sauce_init_region) (On ketchup_1 living_room_table_ketchup_init_region) (On milk_1 living_room_table_milk_init_region) (On orange_juice_1 living_room_table_orange_juice_init_region) (On butter_1 living_room_table_butter_init_region) (On basket_1 living_room_table_basket_init_region) ) (:goal #目标条件 (And (In alphabet_soup_1 basket_1_contain_region) (In tomato_sauce_1 basket_1_contain_region)) ) )BDDL 只负责 场景逻辑。物理规则物体怎么掉落、怎么碰撞、机器人关节怎么运动等是由MuJoCo robosuite这套仿真系统统一管理的。仿真时当你创建环境 OffScreenRenderEnv 或 RobosuiteEnv 时底层会自动加载 MuJoCo 的物理引擎。所有物体都有预先定义好的物理属性质量、摩擦系数、碰撞形状等这些属性在 robosuite 的 XML 模型文件中定义。每一步 env.step(action) 时MuJoCo 都会计算真实的物理模拟重力、碰撞、力反馈等。MuJoCo 的 MJCF 格式 文件用于定义仿真环境中单个物体的视觉外观、碰撞形状、物理属性mujoco modeltextured !-- 这个物体的名字 -- asset texture filetexture_map.png nametex-textured type2d / !-- 贴图 -- material nametextured reflectance0.5 texrepeat1 1 texturetex-textured texuniformfalse / !-- 材质 -- mesh filevisual/textured_vis.msh nametextured_vis scale0.01 0.01 0.01 //asset !-- 3D 模型网格 -- worldbody body body nameobject geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typemesh meshtextured_vis conaffinity0 contype0 group1 materialtextured /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.00000 -0.00104 -0.00235 quat0.50000 -0.50000 0.50000 0.50000 size0.01874 0.02352 0.03625 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02599 -0.00000 -0.00209 quat0.70711 0.70711 0.00000 -0.00000 size0.00226 0.01471 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.02470 -0.00060 -0.00209 quat0.70711 0.70711 0.00000 -0.00000 size0.00226 0.01662 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.00012 -0.00060 -0.02413 quat0.50000 -0.50000 0.50000 0.50000 size0.00421 0.01985 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.00012 -0.00060 0.01776 quat0.50000 -0.50000 0.50000 0.50000 size0.00421 0.01985 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.00012 -0.00060 -0.03260 quat0.50000 0.50000 0.50000 -0.50000 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.00012 -0.00060 0.02575 quat0.50000 0.50000 0.50000 -0.50000 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.02944 -0.00060 -0.00291 quat0.00030 0.00030 -0.70711 0.70711 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02931 -0.00060 -0.00291 quat0.70711 0.70711 0.00030 -0.00030 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02689 -0.00060 0.00853 quat0.69661 0.69661 -0.12141 0.12141 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.02654 -0.00060 -0.01619 quat0.16993 -0.16993 0.68638 0.68638 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.01763 -0.00060 -0.02495 quat0.30330 -0.30330 0.63875 0.63875 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.00964 -0.00060 -0.03099 quat0.41278 -0.41278 0.57412 0.57412 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.01270 -0.00060 0.02274 quat0.41278 -0.41278 0.57412 0.57412 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.01240 -0.00060 -0.02961 quat0.36902 0.36902 -0.60318 0.60318 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02167 -0.00060 -0.02144 quat0.65137 0.65137 0.27516 -0.27516 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02696 -0.00099 -0.01169 quat0.05205 0.05205 -0.70519 0.70519 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.02700 -0.00060 0.00886 quat0.13049 0.13049 -0.69496 0.69496 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.02005 -0.00060 0.01808 quat0.65572 0.65572 0.26463 -0.26463 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos0.02026 -0.00060 0.01494 quat0.20946 -0.20946 0.67537 0.67537 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 /geom solimp0.998 0.998 0.001 solref0.001 1 density100 friction0.95 0.3 0.1 typebox pos-0.01084 -0.00060 0.02397 quat0.56204 -0.56204 0.42908 0.42908 size0.00177 0.00694 0.03760 group0 rgba0.8 0.8 0.8 0.3 //body site rgba0 0 0 0 size0.005 pos0 0 -0.04 namebottom_site / site rgba0 0 0 0 size0.005 pos0 0 0.04 nametop_site / site rgba0 0 0 0 size0.005 pos0.025 0.025 0 namehorizontal_radius_site / /body /worldbody /mujoco​OGBench包含8 类环境、85 个数据集、410 个任务。支持像素观察Pixel-based和状态观察State-based。基于MuJoCo / Gymnasium易于使用。重点挑战长时序推理Long-horizon、技能组合Stitching、随机性、像素输入等。环境类型Locomotion移动PointMaze、AntMaze、HumanoidMaze、AntSoccer蚂蚁踢球等。Manipulation操纵Cube积木、Scene场景如抽屉按钮、Puzzle拼图/灯光熄灭。DrawingPowderworld一种绘图/粒子环境。humanoidmaze-large-navigate-v0.npz ├── observations shape: (2,000,000, 69) ← 200万个状态每个69维 ├── actions shape: (2,000,000, 21) ← 200万个动作每个21维 ├── next_observations shape: (2,000,000, 69) ← 200万个下一状态 └── terminals shape: (2,000,000,) ← 200万个结束标记0或1硬编码的名称解析task在仿真器里面定义我真的绷不住了Task 0: task1_horizontal init: [[0.425, 0.1, 0.02]] ← 方块初始位置桌子上的 x,y,z 坐标 goal: [[0.425, -0.1, 0.02]] ← 方块目标位置 ​ Task 1: task2_vertical1 init: [[0.35, 0.0, 0.02]] goal: [[0.50, 0.0, 0.02]] ​ Task 2: task3_vertical2 init: [[0.50, 0.0, 0.02]] goal: [[0.35, 0.0, 0.02]] ​ Task 3: task4_diagonal1 init: [[0.35, -0.2, 0.02]] goal: [[0.50, 0.2, 0.02]] ​ Task 4: task5_diagonal2 init: [[0.35, 0.2, 0.02]] goal: [[0.50, -0.2, 0.02]]编码器环境定义大致如下import mujoco import numpy as np from dm_control import mjcf ​ from ogbench.manipspace import lie from ogbench.manipspace.envs.manipspace_env import ManipSpaceEnv ​ ​ class CubeEnv(ManipSpaceEnv): Cube environment. ​ This environment consists of a single or multiple cubes. The goal is to move the cubes to target positions. It supports the following variants: - env_type: single, double, triple, quadruple. ​ def __init__(self, env_type, permute_blocksTrue, *args, **kwargs): Initialize the Cube environment. ​ Args: env_type: Environment type. One of single, double, triple, or quadruple. permute_blocks: Whether to randomly permute the order of the blocks at task initialization. *args: Additional arguments to pass to the parent class. **kwargs: Additional keyword arguments to pass to the parent class. self._env_type env_type self._permute_blocks permute_blocks ​ if self._env_type single: self._num_cubes 1 elif self._env_type double: self._num_cubes 2 elif self._env_type triple: self._num_cubes 3 elif self._env_type quadruple: self._num_cubes 4 elif self._env_type octuple: self._num_cubes 8 else: raise ValueError(fInvalid env_type: {env_type}) ​ super().__init__(*args, **kwargs) ​ # Define constants. self._cube_colors np.array( [ self._colors[red], self._colors[blue], self._colors[orange], self._colors[green], self._colors[purple], self._colors[yellow], self._colors[magenta], self._colors[gray], ] ) self._cube_success_colors np.array( [ self._colors[lightred], self._colors[lightblue], self._colors[lightorange], self._colors[lightgreen], self._colors[lightpurple], self._colors[lightyellow], self._colors[lightmagenta], self._colors[white], ] ) ​ # Target info. self._target_task cube # The target cube position is stored in the mocap object. self._target_block 0 ​ def set_tasks(self): if self._env_type single: self.task_infos [ dict( task_nametask1_horizontal, init_xyzsnp.array([[0.425, 0.1, 0.02]]), goal_xyzsnp.array([[0.425, -0.1, 0.02]]), ), dict( task_nametask2_vertical1, init_xyzsnp.array([[0.35, 0.0, 0.02]]), goal_xyzsnp.array([[0.50, 0.0, 0.02]]), ), dict( task_nametask3_vertical2, init_xyzsnp.array([[0.50, 0.0, 0.02]]), goal_xyzsnp.array([[0.35, 0.0, 0.02]]), ), dict( task_nametask4_diagonal1, init_xyzsnp.array([[0.35, -0.2, 0.02]]), goal_xyzsnp.array([[0.50, 0.2, 0.02]]), ), dict( task_nametask5_diagonal2, init_xyzsnp.array([[0.35, 0.2, 0.02]]), goal_xyzsnp.array([[0.50, -0.2, 0.02]]), ), ] elif self._env_type double: self.task_infos [ dict( task_nametask1_single_pnp, init_xyzsnp.array( [ [0.425, 0.0, 0.02], [0.425, -0.1, 0.02], ] ), goal_xyzsnp.array( [ [0.425, 0.0, 0.02], [0.425, 0.1, 0.02], ] ), ), dict( task_nametask2_double_pnp1, init_xyzsnp.array( [ [0.35, -0.1, 0.02], [0.50, -0.1, 0.02], ] ), goal_xyzsnp.array( [ [0.35, 0.1, 0.02], [0.50, 0.1, 0.02], ] ), ), dict( task_nametask3_double_pnp2, init_xyzsnp.array( [ [0.35, 0.0, 0.02], [0.50, 0.0, 0.02], ] ), goal_xyzsnp.array( [ [0.425, -0.2, 0.02], [0.425, 0.2, 0.02], ] ), ),Le-wm数据集以pusht为例| 字段 | Shape | Dtype | 含义 | | ------------- | ------------------------ | ------- | ----------------------------------------- | | action | (2,336,736, 2) | float32 | **动作**2 维控制信号通常是末端执行器的 x, y 位移或速度 | | ep_len | (18,685,) | int32 | **每条轨迹的长度**步数共 18,685 条轨迹 | | ep_offset | (18,685,) | int64 | **每条轨迹在总数据中的起始偏移量**用于切分轨迹 | | episode_idx | (2,336,736,) | int64 | **每个 time step 属于哪条轨迹**的索引 | | pixels | (2,336,736, 224, 224, 3) | uint8 | **图像观察**224×224 RGB 图像 | | proprio | (2,336,736, 4) | float32 | **本体感受信息**通常是 (x, y, cosθ, sinθ) 末端执行器状态 | | state | (2,336,736, 7) | float32 | **完整状态**包含方块位置、朝向、末端执行器位置等 | | step_idx | (2,336,736,) | int64 | **每个 time step 在所属轨迹内的步数索引** | ​数据集 pusht_expert_train.h5 本身不包含显式的 task 标签。Task 名称通过Hydra 配置指定核心环境定义YAML# config/eval/pusht.yaml world: env_name: swm/PushT-v1 # ← 关键这里指定了具体 Task 环境 num_envs: ... max_episode_steps: ...swm/PushT-v1 是 stable_worldmodel 库中预定义的环境类它封装了Push-T 的物理规则2D 平面推块Goal 的采样方式goal_offset_steps: 25初始状态重置逻辑Reward / Done / Success 判断Benchmark 核心训练时通过 python train.py datapusht 选中对应数据和配置模型学习该 Task 的动态。评估/规划时通过 eval.py --config-namepusht 加载对应环境。Benchmark评测是如何实现的主要在 config/eval/pusht.yaml eval.py 中定义YAML# config/eval/pusht.yaml 关键字段 eval: num_eval: 50 # 评估多少个 episode eval_budget: 50 # 每个 episode 的规划步数预算 goal_offset_steps: 25 # 如何从 expert 数据中采样 goal dataset_name: pusht_expert_train ​ plan_config: horizon: 5 # 规划 horizon receding_horizon: 5 action_block: 5评测流程eval.py创建 swm.World(env_nameswm/PushT-v1)使用 CEMCross-Entropy Method规划器在世界模型中进行滚动rollout根据环境返回的 success 信号统计Success Rate输出结果到 pusht_results.txt1.环境核心实现任务逻辑文件路径Bash/usr/local/lib/python3.12/dist-packages/stable_worldmodel/envs/pusht/env.py关键部分Python# Success 判断Benchmark 的核心指标 def eval_state(self, goal_state, cur_state): # success if position difference is 20, and angle difference np.pi/9 pos_diff np.linalg.norm(goal_state[:4] - cur_state[:4]) # 前4维agent(x,y) block(x,y) angle_diff np.abs(goal_state[4] - cur_state[4]) # 第5维block 的角度 angle_diff np.minimum(angle_diff, 2 * np.pi - angle_diff) # 角度取最小值考虑周期 success pos_diff 20 and angle_diff np.pi / 9 # ← 核心成功条件 state_dist np.linalg.norm(goal_state - cur_state) # 整体距离用于 reward return success, state_dist # Step 函数每步执行 判断终止 def step(self, action): ... # compute reward and termination terminated, distance self.eval_state(self.goal_state, state) # 调用 success reward -distance return observation, reward, terminated, truncated, info2.Reset 与 Goal 设置任务如何初始化同一文件env.py模块功能描述初始化 (__init__)设置物理空间参数重力、阻尼、定义观测空间Observation Space和动作空间Action Space。支持多种物体形状如 L, T, Z, I, square 等。物理设置 (_setup)创建物理世界添加墙壁边界并根据配置生成智能体和物体的物理实体Body 和 Shape。动作处理 (step)接收智能体的动作通常是目标位置的偏移量使用 PD 控制器比例-微分控制计算加速度驱动智能体运动并推进物理模拟一步。观测与奖励 (_get_obs,eval_state)观测返回智能体和物体的位置、角度、速度等信息。奖励基于物体当前位置与目标位置的距离计算距离越近奖励越高/损失越低。渲染 (render)将物理模拟的状态绘制为 RGB 图像224x224 或 512x512支持human显示窗口和rgb_array返回数组两种模式。3.评估配置Benchmark 参数文件路径Bashle-wm/config/eval/pusht.yaml关键内容YAMLworld: env_name: swm/PushT-v1 num_envs: ${eval.num_eval} # 默认 50 max_episode_steps: ??? # eval_budget eval: num_eval: 50 goal_offset_steps: 25 # 从 expert 轨迹采样 goal 的偏移 eval_budget: 50 # 每 episode 最多 50 步 dataset_name: pusht_expert_train plan_config: horizon: 5 receding_horizon: 5 action_block: 5 # frameskip4.评估主脚本如何运行 Benchmark文件路径Bashle-wm/eval.py核心流程Pythonhydra.main(..., config_namepusht) def run(cfg): world swm.World(**cfg.world, image_shape(224, 224)) # 加载 LeWM model 或 RandomPolicy if policy ! random: model swm.wm.utils.load_pretrained(cfg.policy) policy swm.policy.WorldModelPolicy(solver..., config...) ​ world.set_policy(policy) ​ # 执行评估dataset-based goal-conditioned metrics world.evaluate( datasetdataset, start_steps..., # 起始步 goal_offsetcfg.eval.goal_offset_steps, eval_budgetcfg.eval.eval_budget, episodes_idx..., callables[{method: _set_state}, {method: _set_goal_state}] ) # metrics 中包含 success_rate

相关新闻