| # 项目说明 | |
| 本项目中,`data` 变量是一个 `numpy` 浮点数组,其形状为 `(n, 29)`,其中: | |
| - `n`:观测帧数 | |
| - `29`:每一帧的低维观测数据长度 | |
| 每一行(长度为 29 的 1D 数组)代表一帧观测,其内部结构如下: | |
| | 序号 | 长度 | 字段名 | 说明 | | |
| | ---- | ---- | -------------------- | ------------------------------------ | | |
| | 1 | 1 | `gripper_open` | 抓手张开度(浮点数) | | |
| | 2 | 7 | `joint_velocities` | 7 个关节的速度 | | |
| | 3 | 7 | `joint_positions` | 7 个关节的位置 | | |
| | 4 | 7 | `joint_forces` | 7 个关节受到的力 | | |
| | 5 | 7 | `gripper_pose` | 抓手在空间中的位姿(7 维表示方式) | | |
| Task description: | |
| ['put rubbish in bin', | |
| 'drop the rubbish into the bin', | |
| 'pick up the rubbish and leave it in the trash can', | |
| 'throw away the trash, leaving any other objects alone', | |
| 'chuck way any rubbish on the table rubbish'] | |
| ## 示例 | |
| ```python | |
| import numpy as np | |
| # 假设 data.npy 存储了 shape=(100,29) 的观测数据 | |
| data = np.load("data.npy") # data.shape == (100, 29) | |
| # 取第 i 帧数据 | |
| i = 0 | |
| frame = data[i] # frame.shape == (29,) | |
| # 拆分各个字段 | |
| idx = 0 | |
| gripper_open = frame[idx : idx+1] # shape (1,) | |
| idx += 1 | |
| joint_velocities = frame[idx : idx+7] # shape (7,) | |
| idx += 7 | |
| joint_positions = frame[idx : idx+7] # shape (7,) | |
| idx += 7 | |
| joint_forces = frame[idx : idx+7] # shape (7,) | |
| idx += 7 | |
| gripper_pose = frame[idx : idx+7] # shape (7,) | |
| print("gripper_open:", gripper_open) | |
| print("joint_velocities:", joint_velocities) | |
| # … 以此类推 |