HannesVonEssen commited on
Commit
c4a2be7
·
verified ·
1 Parent(s): 510d176

Publish self-pumped swing policy

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +118 -0
  3. SHA256SUMS +4 -0
  4. manifest.json +94 -0
  5. media/preview.mp4 +3 -0
  6. policy.onnx +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ media/preview.mp4 filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: onnx
3
+ pipeline_tag: reinforcement-learning
4
+ tags: [microduck, microduck-policy, mjlab, robotics, reinforcement-learning, swing]
5
+ license: apache-2.0
6
+ ---
7
+
8
+ # microduck-swing
9
+
10
+ This MicroDuck policy starts motionless at the bottom of a two-cord swing and
11
+ pumps with its articulated head and legs. The best strict 36-second rollout
12
+ reaches a **173.20° full span**; 71 of 100 randomized seeds pass every
13
+ full-horizon physical-validity gate.
14
+
15
+ <video controls muted loop src="https://huggingface.co/HannesVonEssen/microduck-swing/resolve/main/media/preview.mp4" style="max-width:640px;width:100%"></video>
16
+
17
+ The complete task, PPO configuration, selected PyTorch checkpoint and
18
+ selection endpoints, deterministic evaluator, seat generator, printable
19
+ meshes, and collision hulls are in
20
+ [`Vottivott/microduck-playground`](https://github.com/Vottivott/microduck-playground)
21
+ at commit
22
+ [`5eec677`](https://github.com/Vottivott/microduck-playground/commit/5eec677cbf0e092523ee9b33bda57e81b9115817).
23
+
24
+ ## Try it in simulation
25
+
26
+ ```bash
27
+ git clone https://github.com/Vottivott/microduck-playground.git
28
+ cd microduck-playground
29
+ git checkout 5eec677cbf0e092523ee9b33bda57e81b9115817
30
+ uv sync
31
+
32
+ # Reproduce the best strict 36-second audit from the source checkpoint.
33
+ uv run python scripts/evaluate_swing_checkpoint.py \
34
+ experiments/swing/checkpoints/alpha050.pt \
35
+ --output /tmp/swing-seed27.json \
36
+ --device cpu --duration 36 --seed 27
37
+
38
+ # Download the deployment graph separately.
39
+ hf download HannesVonEssen/microduck-swing policy.onnx \
40
+ --local-dir policies/swing
41
+ ```
42
+
43
+ ## Runtime contract
44
+
45
+ - input: `obs`, float32 `[1, 61]`
46
+ - output: `actions`, float32 `[1, 14]`
47
+ - control rate: 50 Hz
48
+ - action scale: 0.7 rad, joint-position targets around MicroDuck HOME
49
+ - observation normalizer: baked into `policy.onnx`
50
+ - entry state: retained in the seat, bottom of the arc, motionless
51
+ - robot: MicroDuck hardware revision 1, 14 Dynamixel XL330 servos
52
+ - mechanism: two independent 380 mm elastic, tension-only cords
53
+ - policy horizon: trained episodically; evaluated for 36 seconds
54
+
55
+ The observation order is `base_ang_vel(3), projected_gravity(3),
56
+ joint_pos(14), joint_vel(14), previous_actions(14), swing_plane_cue(3),
57
+ zeros(4), zeros(6)`.
58
+
59
+ ### Important: the three cue slots are not velocity commands
60
+
61
+ This model preserves the standard 61-D MicroDuck tensor shape, but repurposes
62
+ the usual three twist-command slots as a deployable swing-plane feedback cue:
63
+
64
+ ```text
65
+ [0, body_y_axis_world.x, body_y_axis_world.z]
66
+ ```
67
+
68
+ `body_y_axis_world` must come from the robot's IMU orientation expressed
69
+ relative to the known still-start frame. The remaining 10 command slots are
70
+ zeros. A standard walking runtime that supplies a requested velocity in these
71
+ slots is therefore incompatible without this small observation adapter. No
72
+ cord, pivot, camera, or motion-capture measurement is supplied to the actor.
73
+
74
+ ## Simulation evaluation
75
+
76
+ The selected model is the exact all-row alpha-0.50 final-layer interpolation
77
+ documented in the source repository. Selection uses mechanism validity rather
78
+ than angle alone.
79
+
80
+ | metric | result |
81
+ |---|---:|
82
+ | randomized evaluation | 100 seeds × 36 s |
83
+ | strict full-horizon passes | 71/100 |
84
+ | geometry-debt-free passes | 73/100 |
85
+ | median peak-to-peak span | 163.03° |
86
+ | median final-six half-cycle span | 161.09° |
87
+ | best strict rollout | seed 27, 173.20° |
88
+ | seed-27 cord envelope | 370.38–392.02 mm |
89
+ | seed-27 maximum lateral displacement | 10.35 mm |
90
+ | seed-27 maximum attachment-alignment penalty | 0.02037 |
91
+
92
+ Strict screening rejects a rollout for excessive lateral displacement,
93
+ attachment misalignment, deep cord slack, overextension, NaNs, reset, or
94
+ accumulated geometry debt. The preview is the strict seed-27 rollout; it is
95
+ silent and the overlay reports the running maximum full-span angle.
96
+
97
+ ## Sim-to-real boundary
98
+
99
+ The task retains deployment-oriented MicroDuck modeling, including BAM XL330
100
+ voltage/back-EMF/current behavior, battery variation and load-dependent sag,
101
+ control delay, actuator friction variation, encoder bias, IMU/encoder noise,
102
+ and two independent elastic tension-only cords. The actor uses only
103
+ IMU/encoder/action-history signals available on the robot.
104
+
105
+ This is a **simulation result, not a hardware-validated policy**. It requires
106
+ the retained swing seat, 380 mm cords, and a suitable rigid frame. Cord knots,
107
+ frame flex, textile strap contact, seat padding, real collision geometry,
108
+ servo temperature, assembly tolerances, and the IMU-frame calibration are not
109
+ fully captured. Use a separate safety tether, current limits, an emergency
110
+ stop, a clear exclusion zone, and conservative incremental testing.
111
+
112
+ <a href="https://hfviewer.com/HannesVonEssen/microduck-swing?utm_source=huggingface&amp;utm_medium=embedded_model_card&amp;utm_campaign=HannesVonEssen__microduck-swing_card&amp;utm_content=embedded_card_open_viewer&amp;from=embedded-model-card" target="_blank" rel="noopener">
113
+ <img
114
+ src="https://hfviewer.com/api/card.svg?source=HannesVonEssen%2Fmicroduck-swing&amp;granularity=auto&amp;v=20260516-title-pills-card"
115
+ alt="Architecture graph for HannesVonEssen/microduck-swing. Open in hfviewer"
116
+ width="100%"
117
+ />
118
+ </a>
SHA256SUMS ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ 4a12e5d3bba08b99228353976a908ce2989bc436f3707d0a196523b6be3fdea9 README.md
2
+ 5a8812bc58f96d8a6537fa7433c8bccd19c7855b0a9b9bbb637d11137af70aa9 manifest.json
3
+ 0caa869bcf46ac3ef9029ea73b3998cc86c3e7b4b3314717bd790474354b718d policy.onnx
4
+ 558651776cd5798e73c69048d8496b44d776606612ce888a2bc79e7c9f46a289 media/preview.mp4
manifest.json ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": 3,
3
+ "model_api": 1,
4
+ "name": "microduck-swing",
5
+ "kind": "episodic",
6
+ "obs_len": 61,
7
+ "action_len": 14,
8
+ "action_scale": 0.7,
9
+ "entry_pose": "retained in swing seat at the bottom of the arc, motionless",
10
+ "duration_s": 36.0,
11
+ "status": "sim-only-hardware-candidate",
12
+ "description": "Self-pumped MicroDuck swing policy on two 380 mm elastic, tension-only cords.",
13
+ "observation": {
14
+ "layout": "base_ang_vel(3), projected_gravity(3), joint_pos(14), joint_vel(14), previous_actions(14), swing_plane_cue(3), zero_head(4), zero_body(6)",
15
+ "swing_plane_cue": "[0, body_y_axis_world.x, body_y_axis_world.z] from IMU orientation relative to the still-start frame",
16
+ "privileged_actor_inputs": false,
17
+ "normalizer_baked_into_onnx": true
18
+ },
19
+ "robot": {
20
+ "model": "microduck",
21
+ "hw_rev": 1,
22
+ "servos": "14x Dynamixel XL330",
23
+ "control_hz": 50,
24
+ "hardware_modifications_required": true
25
+ },
26
+ "mechanism": {
27
+ "cord_count": 2,
28
+ "cord_model": "independent elastic tension-only tendons",
29
+ "rest_length_m": 0.38,
30
+ "stiffness_n_m": 2000.0,
31
+ "simulation_limit_m": 0.395,
32
+ "anchor_height_m": 0.75,
33
+ "seat": "retained-seat generator and printable meshes in Vottivott/microduck-playground"
34
+ },
35
+ "training": {
36
+ "task_id": "Mjlab-SwingPump-MicroDuck",
37
+ "algorithm": "PPO (rsl_rl)",
38
+ "repo": "Vottivott/microduck-playground",
39
+ "source_commit": "5eec677cbf0e092523ee9b33bda57e81b9115817",
40
+ "upstream_base": "pollen-robotics/microduck_rl@1e79c29c97d8b38aee9eefde77a545860ba7658e",
41
+ "selection": "alpha 0.50 interpolation of all final actor-layer rows between frontier_source_3500.pt and planar_target_3600.pt",
42
+ "selected_checkpoint_sha256": "bd10d6b38eaa193dbde589cb9b51259b7469d3eef247cc9cbc121444a16ea2eb",
43
+ "source_checkpoint_sha256": "70e1e82b45b46a62c57943c1c528e26e724902fef76d1c2aa53b3256f2c08b04",
44
+ "target_checkpoint_sha256": "9c80750ad567c19d5183ada5bb98742a86798313a352ce37e36823a2d44be114",
45
+ "export": "scripts/export.py; observation normalizer baked into policy.onnx"
46
+ },
47
+ "eval": {
48
+ "sim_proxy": "mjlab / MuJoCo Warp with BAM XL330 M6 actuator model",
49
+ "seeds": 100,
50
+ "duration_s": 36.0,
51
+ "control_dt_s": 0.02,
52
+ "strict_full_horizon_passes": 71,
53
+ "geometry_debt_free_passes": 73,
54
+ "median_peak_to_peak_deg": 163.0279718838097,
55
+ "median_final_six_half_cycle_peak_to_peak_deg": 161.08761759344662,
56
+ "best_strict_seed": 27,
57
+ "best_strict_peak_to_peak_deg": 173.19988233166998,
58
+ "best_strict_final_six_half_cycle_peak_to_peak_deg": 171.67248924707994,
59
+ "best_strict_max_lateral_m": 0.010354727506637573,
60
+ "best_strict_max_attachment_alignment_penalty": 0.020374774932861328,
61
+ "best_strict_cord_envelope_m": [0.370378702878952, 0.392024964094162],
62
+ "strict_gates": {
63
+ "deep_slack_below_m": 0.37,
64
+ "overextension_above_m": 0.394,
65
+ "lateral_above_m": 0.02,
66
+ "alignment_penalty_above": 0.05
67
+ }
68
+ },
69
+ "sim2real": {
70
+ "retained": [
71
+ "BAM XL330 M6 voltage control, back-EMF, current limiting, battery variation, and load-dependent sag",
72
+ "control delay and actuator friction variation",
73
+ "encoder bias and IMU/encoder observation noise",
74
+ "two independent elastic tension-only cord dynamics"
75
+ ],
76
+ "hardware_validated": false,
77
+ "known_limits": [
78
+ "cord knots and frame compliance",
79
+ "textile strap contact and seat padding",
80
+ "real collision geometry and assembly tolerance",
81
+ "servo temperature",
82
+ "still-start IMU frame calibration"
83
+ ]
84
+ },
85
+ "media": {
86
+ "preview": "media/preview.mp4",
87
+ "preview_seed": 27,
88
+ "preview_duration_s": 36.0,
89
+ "audio": false,
90
+ "camera": "fixed",
91
+ "overlay": "running maximum full-span angle"
92
+ },
93
+ "source_artifact_sha256": "0caa869bcf46ac3ef9029ea73b3998cc86c3e7b4b3314717bd790474354b718d"
94
+ }
media/preview.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:558651776cd5798e73c69048d8496b44d776606612ce888a2bc79e7c9f46a289
3
+ size 7003769
policy.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0caa869bcf46ac3ef9029ea73b3998cc86c3e7b4b3314717bd790474354b718d
3
+ size 793720