Robotics
LeRobot
Safetensors
Piper
diffusion-policy
imitation-learning
RoboticsCollectiveAachen commited on
Commit
23857d2
·
verified ·
1 Parent(s): bd6ff9e

Update model card

Browse files
Files changed (1) hide show
  1. README.md +170 -10
README.md CHANGED
@@ -1,19 +1,179 @@
1
  ---
 
2
  library_name: lerobot
3
- tags: [lerobot, robotics, diffusion-policy, piper]
4
- datasets: [Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1]
 
 
 
 
 
 
 
5
  ---
6
- # Diffusion Policy: Piper hexagonal bolt insertion
7
 
8
- LeRobot Diffusion Policy trained on [`Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1`](https://huggingface.co/datasets/Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1)
9
- (100 teleoperated demos, AgileX Piper, cameras `overhead` and `angled`, 7-D absolute joint-position actions).
10
 
11
- - 100k steps, batch 32 (~30 epochs), fp32, Quadro RTX 6000
12
- - Images resized to 240x320, no crop; ResNet-18 (ImageNet init), separate encoder per camera
13
- - n_obs_steps 2, horizon 64, n_action_steps 32; DDIM with 10 inference steps
14
- - Inference: ~1.2 GB VRAM, ~110 ms per action chunk on an RTX 6000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ```python
 
 
17
  from lerobot.policies.diffusion.modeling_diffusion import DiffusionPolicy
18
- policy = DiffusionPolicy.from_pretrained("RoboticsCollectiveAachen/diffusion_piper_hex_bolt_insertion")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ```
 
1
  ---
2
+ license: apache-2.0
3
  library_name: lerobot
4
+ pipeline_tag: robotics
5
+ tags:
6
+ - robotics
7
+ - lerobot
8
+ - diffusion-policy
9
+ - piper
10
+ - imitation-learning
11
+ datasets:
12
+ - Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1
13
  ---
 
14
 
15
+ # Diffusion Policy: Piper Hexagonal Bolt Insertion (100 demos, 100k steps)
 
16
 
17
+ A Diffusion Policy for an AgileX Piper arm that picks up a hexagonal bolt and places it in the matching opening, using two RGB cameras and joint positions. This is the final 100k-step checkpoint, trained on the first, 100-demonstration dataset.
18
+
19
+ > **Status:** superseded. Newer policies were trained on a cleaner re-recording of the task, in which every episode starts from the zero home pose: [RoboticsCollectiveAachen/act_piper_hexagonal_bolt_insertion_zero_home](https://huggingface.co/RoboticsCollectiveAachen/act_piper_hexagonal_bolt_insertion_zero_home) and [RoboticsCollectiveAachen/smolvla_piper_hex_bolt_insertion_80](https://huggingface.co/RoboticsCollectiveAachen/smolvla_piper_hex_bolt_insertion_80). Prefer those. This model has not been evaluated on the robot.
20
+
21
+ ---
22
+
23
+ ## Model Details
24
+
25
+ - **Method:** [Diffusion Policy](https://huggingface.co/papers/2303.04137), trained from scratch with [LeRobot](https://github.com/huggingface/lerobot) (vision backbone initialized from ImageNet)
26
+ - **Robot:** AgileX Piper, single arm (`piper_follower`), joint-space control
27
+ - **Task:** "Pick up the hexagonal bolt and place it in the matching opening."
28
+ - **Control rate:** 30 Hz
29
+ - **Developed by:** RoboticsCollectiveAachen
30
+ - **License:** Apache 2.0
31
+
32
+ ### Architecture
33
+
34
+ | Setting | Value |
35
+ | --- | --- |
36
+ | Vision backbone | ResNet-18, initialized from ImageNet (`IMAGENET1K_V1`), separate encoder per camera, spatial softmax (32 keypoints) |
37
+ | Image preprocessing | 480 × 640 resized to 240 × 320, no crop |
38
+ | Denoising network | 1-D conditional U-Net, channels 512 / 1024 / 2048, kernel 5, 8 groups, FiLM conditioning |
39
+ | Noise schedule (training) | 100 DDPM timesteps, `squaredcos_cap_v2`, ε-prediction, samples clipped to ±1 |
40
+ | Sampler (inference) | DDIM, 10 steps |
41
+ | Observation history / horizon / actions executed | 2 / 64 / 32 |
42
+ | Parameters | 277.9 M |
43
+
44
+ ## Inputs & Outputs
45
+
46
+ | Feature | Shape | Description |
47
+ | --- | --- | --- |
48
+ | `observation.images.overhead` | 3 × 480 × 640 | Overhead RGB camera |
49
+ | `observation.images.angled` | 3 × 480 × 640 | Angled RGB camera |
50
+ | `observation.state` | 7 | Measured positions: joints 1–6 (degrees), then gripper opening (mm) |
51
+ | `action` (output) | 7 | **Absolute** follower targets in the same order and units as the state |
52
+
53
+ From the last 2 observations, the policy plans a 64-step action trajectory and executes the first 32 (1.07 s at 30 FPS) before replanning.
54
+ Images are normalized with mean/std statistics. State and action are min/max-scaled to [−1, 1] using the training-dataset range.
55
+ The bundled pre/post-processors apply this automatically.
56
+ Because samples are clipped to ±1, the policy cannot command targets outside the range covered by the training data.
57
+
58
+ ## Training Data
59
+
60
+ [Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1](https://huggingface.co/datasets/Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1)
61
+
62
+ - **Episodes:** 100 teleoperated demonstrations (Piper follower driven by a 7-servo Piper leader)
63
+ - **Frames:** 104,172 at 30 FPS (≈ 58 min). Episodes are 26–53 s long (mean 35 s)
64
+ - **Recording limits:** firmware speed 40 %, max target offset 4 °/mm, joint 4 locked at 0 °
65
+ - **Start pose:** not standardized across episodes
66
+
67
+ <a class="flex" href="https://huggingface.co/spaces/lerobot/visualize_dataset?path=Samisaliveagain/piper-hexagonal-bolt-insertion-100-demos-v1">
68
+ <img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/visualize-this-dataset-xl.svg"/>
69
+ <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/badges/resolve/main/visualize-this-dataset-xl-dark.svg"/>
70
+ </a>
71
+
72
+ ## Training Procedure
73
+
74
+ | Setting | Value |
75
+ | --- | --- |
76
+ | Hardware | 1 × NVIDIA Quadro RTX 6000 (24 GB) |
77
+ | Batch size | 32 |
78
+ | Optimizer | Adam, lr 1e-4, betas (0.95, 0.999), weight decay 1e-6 |
79
+ | LR schedule | cosine, 500 warmup steps |
80
+ | Gradient clipping | 10.0 |
81
+ | Precision | fp32 |
82
+ | Steps (this checkpoint) | 100,000 (≈ 3.2 M samples, ≈ 31 epochs), 10 h 54 min |
83
+ | Image augmentation | none |
84
+ | Seed | 1000 |
85
+
86
+ **Training loss** (MSE of the predicted noise, in normalized units):
87
+
88
+ | Step | 10k | 20k | 30k | 40k | 50k | 60k | 70k | 80k | 90k | 100k |
89
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
90
+ | Loss | 0.010 | 0.007 | 0.007 | 0.005 | 0.005 | 0.004 | 0.003 | 0.003 | 0.003 | 0.002 |
91
+
92
+ These are training-set losses. The dataset has no held-out split, so they do not measure
93
+ overfitting or task success. The loss was still falling when training stopped.
94
+ Intermediate checkpoints (every 10k steps) are not published.
95
+
96
+ ## How to Use
97
+
98
+ LeRobot has no built-in Piper robot driver, so `lerobot-rollout` cannot drive this
99
+ arm directly. Load the policy inside your own 30 Hz control loop:
100
 
101
  ```python
102
+ import torch
103
+ from lerobot.policies import make_pre_post_processors
104
  from lerobot.policies.diffusion.modeling_diffusion import DiffusionPolicy
105
+
106
+ repo = "RoboticsCollectiveAachen/diffusion_piper_hex_bolt_insertion"
107
+ policy = DiffusionPolicy.from_pretrained(repo).to("cuda").eval()
108
+ preprocessor, postprocessor = make_pre_post_processors(
109
+ policy.config, pretrained_path=repo
110
+ )
111
+
112
+ policy.reset() # at the start of every episode (clears the observation history and action queue)
113
+ while running: # 30 Hz
114
+ obs = {
115
+ "observation.state": state, # torch.float32, shape (7,): joints 1-6 [deg], gripper [mm]
116
+ "observation.images.overhead": img_ovh, # torch.float32, shape (3, 480, 640), RGB in [0, 1]
117
+ "observation.images.angled": img_ang, # same format
118
+ }
119
+ with torch.inference_mode():
120
+ action = postprocessor(policy.select_action(preprocessor(obs)))
121
+ send_absolute_joint_targets(action.squeeze(0)) # 7 values, same order/units as the state
122
+ ```
123
+
124
+ **Inference cost** (measured on a Quadro RTX 6000): about 1.2 GB of VRAM and about 110 ms per replanning step.
125
+ Replanning happens once every 32 control steps; the other `select_action` calls only pop the next queued action.
126
+ Laptop GPUs with 8 GB are enough.
127
+
128
+ **Deployment notes**
129
+
130
+ - Episodes in the training data do not share a common start pose. Start each rollout from a pose similar to those in the dataset.
131
+ - Apply the same safety limits used during recording: firmware speed 40 % and a maximum
132
+ target offset of 4 °/mm from the measured position. The training actions are the targets
133
+ *after* this limiting, so the policy has never seen large jumps.
134
+ - Joint 4 was locked to a 0 ° target in the training data. Keep it locked, or force its target to 0.
135
+ - Camera placement, resolution (640 × 480), and the `overhead`/`angled` key names must match
136
+ the recording setup. Pass full-resolution frames; the policy resizes them itself.
137
+ - The ~110 ms replanning step happens inside one control tick. Either let that tick run long,
138
+ or run inference in a separate thread so the 30 Hz loop keeps sending the queued actions.
139
+
140
+ ## Evaluation
141
+
142
+ _No real-robot evaluation has been run on this checkpoint yet._
143
+
144
+ <!-- Fill in after testing on the robot:
145
+
146
+ | Setup | Trials | Successes | Success rate |
147
+ | --- | --- | --- | --- |
148
+ | Training configuration | 10 | ? | ?% |
149
+ -->
150
+
151
+ ## Limitations
152
+
153
+ - Trained on a single robot, cell, camera setup, and object. Expect degraded behavior under
154
+ different lighting, camera poses, bolt or fixture positions outside the demonstrated range,
155
+ or a different Piper unit.
156
+ - The training demonstrations carry no success labels and were not exhaustively reviewed,
157
+ so the policy imitates whatever the operator did, including imperfect attempts.
158
+ - Single-task policy. It takes no language input.
159
+ - Trained without image augmentation, so it may be more sensitive to lighting and camera changes than the ACT models.
160
+ - Run it with a hand on the emergency stop. Nothing in the model enforces joint limits,
161
+ collision avoidance, or force limits.
162
+
163
+ ## Citation
164
+
165
+ ```bibtex
166
+ @article{chi2024diffusionpolicy,
167
+ author = {Cheng Chi and Zhenjia Xu and Siyuan Feng and Eric Cousineau and Yilun Du and Benjamin Burchfiel and Russ Tedrake and Shuran Song},
168
+ title = {Diffusion Policy: Visuomotor Policy Learning via Action Diffusion},
169
+ journal = {The International Journal of Robotics Research},
170
+ year = {2024}
171
+ }
172
+
173
+ @misc{cadene2024lerobot,
174
+ author = {Cadene, Remi and Alibert, Simon and Soare, Alexander and Gallouedec, Quentin and Zouitine, Adil and Palma, Steven and Kooijmans, Pepijn and Aractingi, Michel and Shukor, Mustafa and Aubakirova, Dana and Russi, Martino and Capuano, Francesco and Pascal, Caroline and Choghari, Jade and Moss, Jess and Wolf, Thomas},
175
+ title = {LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch},
176
+ howpublished = "\url{https://github.com/huggingface/lerobot}",
177
+ year = {2024}
178
+ }
179
  ```