File size: 8,830 Bytes
42c88da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
---
license: bsd-3-clause
task_categories:
  - robotics
tags:
  - robotics
  - manipulation
  - imitation-learning
  - peg-in-hole
  - insertion
  - isaac-lab
  - teleoperation
  - behavior-cloning
  - diffusion-policy
size_categories:
  - n<1K
---

# Geometry-Conditioned Insertion

Human teleoperation demonstrations for a peg-in-hole insertion benchmark that
scores a policy on its **behavior during the rollout**, not only on whether it
finished the task.

Collected in [NVIDIA Isaac Lab](https://github.com/isaac-sim/IsaacLab) with a
Franka Panda. 420 episodes across six datasets, at least 50 per experiment.

**Code, benchmark and results:**
https://github.com/CrocoWilly/do-policies-adapt-to-geometry

**Accepted at IEEE/SICE SII 2027, Kobe, Japan.**

---

## What the experiments measure

Five independent experiments, each isolating a different aspect of geometric
capability. Every dataset below is the training data for one of them.

| File | Episodes | Size | Experiment | Capability under test |
|---|---|---|---|---|
| `Diagnosis0_dataset_forTraining.hdf5` | 50 | 1.1 GB | Skill Check | Can the policy insert at all? |
| `Diagnosis1_dataset_forTraining.hdf5` | 50 | 1.1 GB | Alignment Adaptation | Does it align *more* for a tight hole than a loose one? |
| `Diagnosis2_dataset_forTraining.hdf5` | 50 | 1.3 GB | Strategy Diversity | When two orientations both fit, does it use both? |
| `Diagnosis3_dataset_forTraining.hdf5` | 60 | 1.6 GB | Strategy Disambiguation | When only one fits, does it pick that one? |
| `Diagnosis4_dataset_forTraining.hdf5` | 90 | 1.9 GB | Hole Identification | Does it match peg shape to hole shape? |
| `MainExp_dataset_forTraining.hdf5` | 120 | 2.6 GB | Appearance × geometry sweep | Used for the auxiliary-loss experiments |
| `MainExp_dataset_anchorPool_forTraining.hdf5` | 2,578 anchors | 304 MB | — | Anchor pool for the Relative Geometry-Appearance Loss |

The Diagnosis sets are independent, so there is no need to download all 10.1 GB
to run one experiment.

## Download

```bash
pip install huggingface_hub

# everything
hf download CrocoWilly/geometry-conditioned-insertion \
    --repo-type dataset --local-dir datasets/

# or a single experiment
hf download CrocoWilly/geometry-conditioned-insertion \
    Diagnosis1_dataset_forTraining.hdf5 \
    --repo-type dataset --local-dir datasets/
```

## Format

Standard [robomimic](https://github.com/ARISE-Initiative/robomimic) HDF5 layout —
a `data` group with one subgroup per episode.

```
data/                     attrs: env_args
  demo_0/                 attrs: num_samples, success
    obs/                  19 keys, 22 in three of the datasets — see below
    actions           (T, 4)  float32  the key robomimic trains on
    action_world_4d   (T, 4)  float32  [dx, dy, dz, dyaw], world frame
    action_hole_4d    (T, 4)  float32  the same action in the hole frame
    processed_actions (T, 8)  float32  the raw recorded action, before conversion
    states/                            full simulator state, for replay
    initial_state/                     episode reset state
  demo_1/
  ...
```

The action space is 4D. Roll and pitch are held fixed and the gripper stays
closed on the peg, so the policy controls exactly the degrees of freedom the
insertion needs and nothing else. `actions` is a byte-identical copy of
`action_world_4d`, kept under the name robomimic expects.

`states` and `initial_state` are retained, so an episode can be replayed in
Isaac Lab rather than only used as supervision.

### Observations

Every episode records far more than the baselines consume. The published
BC-LSTM and Diffusion Policy baselines train on **three keys only** — marked
**[train]** below. The rest are recorded so the data supports experiments
beyond the ones in the thesis: depth-based policies, wrist-camera policies,
joint-space control, or privileged-information baselines.

| Key | Shape (per step) | |
|---|---|---|
| `table_side_cam` | (200, 200, 3) uint8 | **[train]** side-view RGB |
| `ee_pos_world` | (3,) float32 | **[train]** end-effector position, world frame |
| `ee_yaw_world` | (1,) float32 | **[train]** end-effector yaw, world frame |
| `table_front_cam` | (200, 200, 3) uint8 | front-view RGB |
| `wrist_cam` | (200, 200, 3) uint8 | wrist-mounted RGB |
| `table_side_cam_depth` | (200, 200, 1) float32 | side-view depth |
| `table_front_cam_depth` | (200, 200, 1) float32 | front-view depth |
| `wrist_cam_depth` | (200, 200, 1) float32 | wrist-mounted depth |
| `joint_pos`, `joint_vel` | (9,) float32 | arm + gripper joint state |
| `ee_quat_world` | (4,) float32 | end-effector orientation |
| `peg_pos_world`, `peg_quat_world` | (3,), (4,) float32 | peg pose |
| `hole_pos_world`, `hole_quat_world` | (3,), (4,) float32 | hole pose |
| `hole_yaw_world` | (1,) float32 | hole yaw |
| `ee_pos_rel`, `ee_yaw_rel` | (3,), (1,) float32 | end-effector pose in the hole frame |
| `clearance` | (1,) float32 | peg-hole clearance for this episode |

Those 19 keys are present in every dataset. Three of them carry extra keys for
what their experiment varies:

| Dataset | Extra keys |
|---|---|
| `Diagnosis3` | `ee_yaw_rel_slot2`, `peg_pos_rel`, `peg_yaw_rel` — the second candidate slot |
| `Diagnosis4` | `peg_shape_no`, `hole_shape_codes` (3,), `hole_slot_positions_world` (9,) — which of three holes matches the peg |
| `MainExp` | `box_color_no`, `peg_texture_no`, `table_texture_no` — the appearance factors |

Because geometry and appearance are recorded separately per episode, pairs of
observations differing in exactly one of the two can be sampled — which is what
the Relative Geometry-Appearance Loss needs.

### Anchor pool

A separate file holding **2,578 decision-critical time-steps** — the peg close
to the hole surface and still misaligned — sampled by the auxiliary loss. Built
from `MainExp_dataset_forTraining.hdf5`.

```
anchors/
  anchor_0/
    obs/
      table_side_cam   (200, 200, 3)
      ee_pos_world     (3,)
      ee_yaw_world     (1,)
    attrs: color, peg_texture, table_texture, size, delta_z, yaw_error_deg
  ...
attrs: source_file, total_anchors, z_diff_min, z_diff_max,
       yaw_error_threshold_deg, yaw_rotation_diff_threshold,
       peg_length, hole_height
```

## Collection

Keyboard teleoperation in Isaac Lab, recorded at 25 Hz. Teleoperation was
retuned for insertion rather than pick-and-place: position sensitivity lowered
to 0.0125 for the fine alignment the task demands, rotation sensitivity raised
so yaw correction stayed practical.

The recorder applies per-episode randomization of geometry and appearance, so
each episode is a different instance of its experiment rather than a repeat.

Raw recordings use a 7D action; the published files have been converted to the
4D form and had per-episode clearance and depth scaling attached. The conversion
scripts are in the
[GitHub repository](https://github.com/CrocoWilly/do-policies-adapt-to-geometry/tree/main/datasets).

## Inspecting a file

```python
import h5py

with h5py.File("Diagnosis1_dataset_forTraining.hdf5", "r") as f:
    demos = list(f["data"].keys())
    print(len(demos), "episodes")
    d = f["data"][demos[0]]
    print({k: d["obs"][k].shape for k in d["obs"]})
    print("actions", d["actions"].shape)
```

The repository also ships `Check_hdf5_structure.py`, `List_episodes.py` and
`View_hdf5_images.py` for structure dumps and frame-by-frame playback.

## Citation

The benchmark and the relative loss are published at IEEE/SICE SII 2027:

```bibtex
@inproceedings{chen2027geometry,
  title     = {Do Robot Policies Adapt to Geometry? Diagnosing and Learning
               Geometry-Conditioned Behavior in Insertion Tasks},
  author    = {Chen, Yen-Chang and Chu, Wei-Ta},
  booktitle = {Proceedings of the IEEE/SICE International Symposium on
               System Integration (SII)},
  address   = {Kobe, Japan},
  year      = {2027},
  note      = {To appear}
}
```

The full study, including the experiments not covered in the paper:

```bibtex
@mastersthesis{chen2026geometry,
  title  = {Do Robot Policies Adapt to Geometry? Diagnosing and Learning
            Geometry-Conditioned Behavior in Insertion Tasks},
  author = {Chen, Yen-Chang},
  school = {National Cheng Kung University},
  year   = {2026}
}
```

## Acknowledgment

Collected at the Multimedia and Computer Vision Laboratory, National Cheng Kung
University, under the supervision of Prof. Wei-Ta Chu.

Funded in part by the National Science and Technology Council, Taiwan, under
grants 115-2622-8-006-015, 114-2622-E-006-028, 114-2221-E-006-047-MY3,
112-2221-E-006-136-MY3, 115-2425-H-006-005, and 114-2634-F-006-002.

## License

BSD-3-Clause, matching Isaac Lab. The demonstrations were collected by the
author in simulation; no third-party or human-subject data is involved.