File size: 5,801 Bytes
7f77dd7
 
 
 
 
 
 
e066835
7f77dd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e066835
 
 
 
 
7f77dd7
 
 
 
 
e066835
 
 
 
 
 
 
 
 
 
 
 
7f77dd7
e066835
 
 
7f77dd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
task_categories:
  - robotics
tags:
  - robotics
  - manipulation
  - contact-rich-manipulation
  - force-torque
  - imitation-learning
  - flow-matching
  - zarr
pretty_name: ForceFlow Dataset
size_categories:
  - 10G<n<100G
---

# ForceFlow Dataset

**ForceFlow: Learning to Feel and Act via Contact-Driven Flow Matching**

[[Project Page](https://jokeresc.github.io/ForceFlow-page)] | [[Code](https://github.com/JokerESC/ForceFlow)]

![motivation](https://huggingface.co/datasets/JokerESC/ForceFlow/resolve/main/motivation-1.png)

Contact-rich manipulation remains one of the hardest problems in robot learning: vision alone cannot capture the high-frequency contact dynamics that determine whether a plug seats correctly, a stamp triggers cleanly, or a wipe exerts consistent pressure. This dataset is collected to support **ForceFlow**, a force-aware reactive framework built on flow matching that addresses this gap.

ForceFlow fuses temporal force/torque history with visual observations through an asymmetric multimodal design — force history acts as a global regulation signal to prevent it from being overshadowed by high-dimensional image features, while a hybrid action space jointly predicts end-effector motion and expected next-step contact force. To handle spatial generalization, ForceFlow introduces a **Vision-to-Force (V2F) handover**: a VLM first localizes the target in the scene, then control passes to the force-aware policy for precise local contact interaction.

This dataset contains **7 real-robot teleoperated demonstration tasks** spanning two categories of contact-rich manipulation, collected on a UFACTORY xArm6 equipped with a 6-axis wrist F/T sensor and dual Intel RealSense cameras.

---

## Tasks

**Short-horizon contact** — tasks requiring precise force application at a specific moment:

| Task | Episodes | Total Steps | Key Challenge |
|---|---|---|---|
| `stamp` | 100 | 45,867 | Visual ambiguity in paper thickness; force-triggered stamping |
| `plug` | 100 | 50,107 | Coarse visual alignment with force-guided insertion |
| `press_button` | 50 | 23,396 | Varying spring constants and trigger depths |
| `insert` | 50 | 25,032 | Sub-millimeter tolerance and geometric jamming |

**Continuous contact** — tasks requiring sustained force regulation throughout execution:

| Task | Episodes | Total Steps | Key Challenge |
|---|---|---|---|
| `clean_whiteboard` | 100 | 56,810 | Stable normal force tracking on a planar surface |
| `clean_vase` | 50 | 85,478 | Adaptive force regulation on a curved, non-linear surface |
| `peel` | 50 | 38,564 | Consistent peel force on adhesive tape |

---

## Data Format

Each task is provided in two formats:

- **`<task>.zarr/`** — Zarr v2 directory store, ready for direct training use
- **`<task>.zip`** — Zipped archive of the same zarr store
- **`<task>_normalizer.json`** — Pre-computed normalizer statistics (mean/std) for all fields

### Zarr Structure

```
<task>.zarr/
├── data/
│   ├── action          (N, 6)   float32  — end-effector delta pose (6-DOF)
│   ├── pos             (N, 6)   float32  — end-effector absolute pose
│   ├── force           (N, 6)   float32  — raw F/T sensor readings
│   ├── delta_force     (N, 6)   float32  — force delta (not in `peel`)
│   ├── gripper_action  (N, 1)   float32  — gripper command (0=open, 1=close)
│   ├── gripper_state   (N, 1)   float32  — gripper current state
│   ├── rgb_arm         (N, 3, 240, 320)  uint8 — wrist camera (JPEG-compressed)
│   └── rgb_fix         (N, 3, 240, 320)  uint8 — fixed camera (JPEG-compressed)
└── meta/
    └── episode_ends    (E,)     uint32   — cumulative step index at each episode end
```

> **Note:** The `peel` task does not contain the `delta_force` field.

RGB arrays are stored with a custom JPEG codec. To read them, install [image_codecs](https://github.com/JokerESC/ForceFlow/tree/main/CleanDiffuser/image_codecs) from the ForceFlow repo and register the codec before opening the zarr store.

---

## Usage

### Prerequisites

```bash
git clone --recurse-submodules https://github.com/JokerESC/ForceFlow.git
cd ForceFlow
pip install -r requirements.txt
pip install -e CleanDiffuser/
```

### Load a dataset

```python
import sys
sys.path.insert(0, 'path/to/ForceFlow/CleanDiffuser')

import numcodecs
import image_codecs
numcodecs.register_codec(image_codecs.jpeg)

import zarr
import numpy as np

z = zarr.open('plug.zarr', 'r')

episode_ends = z['meta/episode_ends'][:]   # shape (100,)
actions      = z['data/action'][:]         # shape (50107, 6)
forces       = z['data/force'][:]          # shape (50107, 6)
rgb_arm      = z['data/rgb_arm'][:]        # shape (50107, 3, 240, 320)

# Reconstruct per-episode slices
starts = np.concatenate([[0], episode_ends[:-1]])
for ep_idx, (s, e) in enumerate(zip(starts, episode_ends)):
    ep_actions = actions[s:e]   # (T, 6)
    ep_forces  = forces[s:e]    # (T, 6)
```

### Training with ForceFlow

```bash
# Edit configs/xarm.yaml to point to the downloaded data
python -m pipeline.train --config configs/xarm.yaml
```

---

## Hardware

| Component | Details |
|---|---|
| Robot arm | UFACTORY xArm6 |
| F/T sensor | 6-axis wrist force/torque sensor |
| Wrist camera | Intel RealSense D435 |
| Fixed camera | Intel RealSense L515 |
| Teleoperation | 3Dconnexion SpaceMouse |

---

## License

MIT — see [LICENSE](https://github.com/JokerESC/ForceFlow/blob/main/LICENSE).

---

## Citation

If you use this dataset, please cite:

```bibtex
@misc{forceflow2025,
  title  = {ForceFlow: Learning to Feel and Act via Contact-Driven Flow Matching},
  author = {JokerESC},
  year   = {2025},
  url    = {https://github.com/JokerESC/ForceFlow}
}
```