diff --git a/.gitattributes b/.gitattributes index 28ff75b81664c56a37193429e2e493b8d09ca630..9e202154075c136c9a7e20321132b7967610d2b3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -69,3 +69,6 @@ traversing/raw/arena_gator_collection_task_files/rigid_v2.json filter=lfs diff=l traversing/raw/arena_gator_collection_task_files/rigid_hmmwv_v1.json filter=lfs diff=lfs merge=lfs -text so101_push_rl/nrd_data/train/index.json filter=lfs diff=lfs merge=lfs -text contact_nrd/g1_locomotion/results/sealed_test_seed61_seed62.json filter=lfs diff=lfs merge=lfs -text +so101_pick_place/nrd/c1_s62/validation.json filter=lfs diff=lfs merge=lfs -text +so101_pick_place/results/nrd/sealed_test.json filter=lfs diff=lfs merge=lfs -text +so101_pick_place/results/nrd/validation_rescore.json filter=lfs diff=lfs merge=lfs -text diff --git a/so101_pick_place/README.md b/so101_pick_place/README.md new file mode 100644 index 0000000000000000000000000000000000000000..371360edbd49301c0c9ee34f46dbbc9e03b7a710 --- /dev/null +++ b/so101_pick_place/README.md @@ -0,0 +1,173 @@ +# SO101 pick-and-place: a camera student trained only in the NRD, tested on the real arm + +Follow-on work to the NeDM paper, not part of it. One camera policy (the "student") drives a real SO101 arm. It picks +a 30 mm cube from the table and places it on a plate. Every training step ran inside the NRD, a learned simulator of +the arm and the cube (neural reduced dynamics). The chain is: NRD, then a state teacher trained with PPO in the NRD, +then a camera student trained in the NRD with ray-traced images of a calibrated copy of the real scene (online DAgger: +the student drives, the teacher gives the labels), then the real arm with no further training. + +No real image was a training sample. Real data set the simulator, the training worlds and the checks: the camera +calibration and scene look (from the two teleop recordings in `robot/lerobot_recordings/`) and the table height; from +S3 on, robot-like servo ranges in the student's training worlds (speed, lag and sag, set from robot timing logs), the +wrist-roll limit of 98 deg (T5 / S4: from the motor range and two robot stalls) and the 10 mm lower table (T6 / S5); +a fitted servo model (used only in the sim checks); and the choice of the student for the robot. Each fine-tune round +(S3, T5 / S4, T6 / S5) answered failures of the student before it on the robot. + +The code, the configs and the commands are in the folders `so101_pick_place/` and `scripts/so101_pick_place/` of +the main branch of the code repository [uwsbel/NeDM](https://github.com/uwsbel/NeDM/tree/main/so101_pick_place) (merged from the branch `so101-pick-place`). The +study history, with every stage commit named below, is the branch `so101-pick-place-study` (tip +`3599103704032ba67cb2736ff0aee501f2e537b9`). Sizes and SHA-256 of every file: `release_manifest.json` (it also holds +the provenance of each folder). + +## Results on the real arm + +Released student: run `v12_tb10_s1210`, checkpoint `it_01000` ("tb10": trained for a table 10 mm lower than the +nominal sim table), SHA-256 `6458a4f791d10521...`. "Place" = the operator typed `p` (cube on the plate). + +| Test | Student | Places | 95 % (Wilson) | +|---|---|---|---| +| Stress test 2026-10-27, 6 sessions | tb10 | **36/50 = 72 %** | 58-83 % | +| Stress test, plate left of the cube (R->L) | tb10 | 19/23 = 83 % | 63-93 % | +| Stress test, plate right of the cube (L->R) | tb10 | 17/27 = 63 % | 44-78 % | +| Screening 2026-10-27, 4 episodes each (D 8) | 7 students | 22/32 = 69 % | 51-82 % | +| Screening 2026-10-27 | tb10 | 4/4 | 51-100 % | +| All sessions 2026-10-24 to 10-27 | reference student D | 19/28 = 68 % (note 1) | 49-82 % | + +- Stress test protocol, as run: the plate stayed in one place in each of the first 5 sessions (sessions `150916` and + `151136` share one place); in the last session it was moved twice (3 places). The cube was moved to many positions + (177-289 mm from the base axis, -47 to +40 deg), cube yaw about 0. One start that stopped at the home pose before + the policy ran is not counted (`eval_20261027_150916/ep_03`). The protocol was not fixed before the test. The study + note `results/robot/STRESS_tb10_20261027.md` says the plate moved once; `stress_episodes.json` shows two moves. +- The cube and plate positions, the directions (R->L, L->R) and the end distances come from + `results/robot/stress_episodes.json`, an image + kinematics estimate whose script was not found (not released). + The placed counts come from the session logs. +- Failures (14 of 50): 6 held the cube at the plate without release (5 of them L->R), 5 grasp failures, 3 released + short of the plate (all L->R). Cubes closer than 19 cm to the base axis: 1/7 placed. +- How tb10 was chosen: it failed the frozen sim rule of its round (`results/sim_checks/SELECTION_RESULT_v12.md`). It + reached the robot under a relaxed lab rule (`LAB_PICK_RULE_v13.md`), written with the v12 gate results of all 24 + checkpoints known (tb10's among them; it passed just above the new G3 place line, 94 vs 90), as the optional fifth + student of a rule that allowed four, and a 4-episode screen of 7 students. The user then chose it for the stress + test. The 50 stress episodes are new episodes, but the choice used robot results. +- D = run `v8_roll_s801`, checkpoint `it_02000` (SHA-256 `d9a35bfc...`), the previous robot student and the start + checkpoint of tb10. +- Note 1: 17/28 if two episodes are not counted where the operator typed `p` with a note that the cube was off the + plate or the mat ("GLP PLACE OFF MAT", "GLP BUT PLACE IN THE WRONG SPOT"). + +Per-episode table: `results/robot/results.md` (built from `robot/logs/` by `scripts/so101_pick_place/robot/build_results.py`). + +## Layout + +| Path | Contents | Size | +|---|---|---| +| `nrd/c1_s62/` | The NRD of every policy stage. `best.pt`: main-compatible copy (note 2). `original/best.pt`: the file the study used (SHA-256 `f45ee8be...`). Training records: `run_config.json`, `train_log.jsonl`, `validation.json`, `complete.json`, `contact_scale.json`, `core_validation.json` | 37 MB | +| `nrd/c0_s62/` | Base NRD (the start weights of `c1_s62`); same files | 28 MB | +| `nrd_data/production_plus/` | 37,500 scripted MuJoCo episodes (12 grasp families), the base NRD's training data | 4.24 GB | +| `nrd_data/noisy_v1/` | 10,000 scripted episodes with policy-like command noise | 1.13 GB | +| `nrd_data/expert_v2/` | 26,763 episodes of a scripted expert through the study's action decoder | 3.03 GB | +| `nrd_data/policy_v3/` | 19,231 MuJoCo episodes of 7 PPO policies of the study; `policies/` holds the 7 policies | 2.21 GB | +| `nrd_test/` | Sealed scripted test set, 3,050 episodes (note 3) | 0.34 GB | +| `teacher/t0_nC1_s62_b/` ... `t6_tppo_v12_fr10_s122/` | 6 teacher checkpoints, the teacher's expert data (`t1_expert_data/`, 24,576 NRD episodes) and the run records | 0.91 GB | +| `student/s0_v2_start_s2/` ... `s5_v12_tb10_s1210/` | 6 student checkpoints (S5 = tb10, S4 = D) and their run records (`args.json`, `meta.json`, `curve.csv`, `progress.jsonl`) | 0.15 GB | +| `rl_inputs/` | Task sets (`tasks/`), start banks (`banks/`), arm geometry (`geometry/`), the task sets of the sim checks (`check_tasks/`) | 28 MB | +| `scene_calib/` | Camera calibration, scene look, part colours, fitted servo model, LeRobot motor calibration (same bytes as `configs/so101_pick_place/` in the code) | 0.1 MB | +| `results/sim_checks/` | Sim-check result of tb10 and of D, the frozen selection rule and its result, the relaxed lab rule and plan | 0.1 MB | +| `results/nrd/` | The sealed NRD test of `c1_s62` and `c0_s62` (`sealed_test.json` + `.txt`, run once on 2026-10-27 with main's `python -m nedm.contact_nrd.test`), the same code on the validation episodes of `production_plus` (`validation_rescore.*`) and the tables of both (`summary_selected.*`: the 7 scored families; `summary_all.*`: all 12) | 27 MB | +| `results/robot/` | Per-episode robot results (`results.json`, `results.md`), stress-test geometry (`stress_episodes.json`), two short test notes | 0.1 MB | +| `robot/logs/` | Raw logs of 19 robot sessions, 102 policy episodes and 1 aborted start (6 stress sessions, 8 screening sessions, 5 sessions of D) | 0.96 GB | +| `robot/videos/` | 50 stress-test videos (one per episode) and 2 compilations (stress test, screening) | 65 MB | +| `robot/lerobot_recordings/` | 2 LeRobot teleop recordings (15 episodes, 640 x 480, 30 fps): calibration input and replay input | 0.12 GB | +| `bundle/so101_hw_v13_tb10/` | The folder installed on the robot computer: code, `student.pt`, calibration, `robot_test.sh`, `MANIFEST.txt` (SHA-256 of every file; built from commit `2b6dc4d8d`) | 26 MB | +| `bundle/so101_hw_v13_tb10.tar.gz` | The same folder as the tarball that was copied to the robot computer | 23 MB | +| `provenance/` | Code snapshots that are in no commit: the base-NRD trainer (`code_v16_base_nrd.tar.gz`) and the `expert_v2` collector (`round2_expert_v2_code.tar.gz`), each with a SHA-256 list | 1.5 MB | + +Total about 13.3 GB. Note 2: the main-compatible NRD files have the two training-only geometry heads removed (config key +`aux_geometry`, tensors `geo_collision.*`, `geo_contact.*`), so that `nedm.contact_nrd.model.load_model` of the +NeDM main branch loads them. `original/best.pt` loads only with the training code at commit `f6f05c21c`. Note 3: the +test set was run once on these two NRDs (2026-10-27, `results/nrd/`); it had been run once before, on 2026-10-10, on an +older NRD design, so it is not fully blind to the choice of the base NRD's config. + +## The training chain + +Each teacher starts from the teacher above it; each student starts from the student above it. All stages ran inside +the NRD `nrd/c1_s62`. GPU: one AMD MI350X (S3: MI300X) per job, T1 and T2 on one RTX 5090. Code commits are on the +study branch. + +| Stage | Folder | Start | Labels | Checkpoint (SHA-256) | Code | Re-run | +|---|---|---|---|---|---|---| +| T0 | `teacher/t0_nC1_s62_b/` | nothing (PPO) | - | `model_00171.pt` (8069d5b3) | e205b801b + NRD code of f6f05c21c | same code | +| T1 | `teacher/t1_expert_data/` | T0 drives 24,576 NRD episodes | - | `e0_n1.npz`, `e1_n2.npz`, `e2_n15.npz` | uncommitted (close to 6ea7ddb6e) | recipe only | +| T2 | `teacher/t2_bc_all/` | nothing (behaviour cloning on T1) | T1 | `bc.pt` (95df5ff7) | uncommitted (close to 6ea7ddb6e) | recipe only | +| T3 | `teacher/t3_jt_b140/` | T2, PPO 140 iterations | - | `model_00140.pt` (41693858) | about 6ea7ddb6e (not exact) | recipe only | +| T4 | `teacher/t4_jt_h110/` | T3, PPO 110 iterations, hold limit 2.5 s | - | `model_00110.pt` (0c1b6142) | 6ea7ddb6e | same recipe | +| T5 | `teacher/t5_tppo_roll_v8_s21/` | T4, PPO 200 iterations, wrist roll limit 98 deg | - | `model_00200.pt` (c4ea842c) | 46f74a797 | same code | +| T6 | `teacher/t6_tppo_v12_fr10_s122/` | T5, PPO 200 iterations, action floor 10 mm higher (as seen from a table 10 mm lower) | - | `model_00200.pt` (069cd896) | 24b71df62 | same code | +| S0 | `student/s0_v2_start_s2/` | ImageNet ResNet18 | T4 | `r2/last.pt` (3fe3fb5a) | b38677cf1 (inferred) | probably same code | +| S1 | `student/s1_v2_online_s18/` | S0 | T4 | `it_03000.pt` (8fe355c7) | b38677cf1 (inferred) | probably same code | +| S2 | `student/s2_v2_online2_s28/` | S1 | T4 | `it_03000.pt` (68d08d0b) | b38677cf1 (inferred) | probably same code | +| S3 | `student/s3_v4_relabel_s63/` | S2 | T4 | `it_02000.pt` (ceebbd2f) | 977863c9e (inferred) | exact only at 977863c9e | +| S4 (D) | `student/s4_v8_roll_s801/` | S3 | T5 | `it_02000.pt` (d9a35bfc) | 46f74a797 | same code | +| S5 (tb10) | `student/s5_v12_tb10_s1210/` | S4 | T6 | `it_01000.pt` (6458a4f7) | 362b48801 | same code | + +NRD: the base NRD `c0_s62` trained from scratch on `production_plus` (seed 62, about 8.5 GPU-h) with uncommitted code +(`provenance/code_v16_base_nrd.tar.gz`). The policy NRD `c1_s62` is `c0_s62` fine-tuned (20,000 updates, best at +update 2,500) on the 4 parts of `nrd_data/` merged, with the train rows of `policy_v3` repeated 2.5 times (code at +commit `f6f05c21c`). The merged file itself (13.6 GB) is not uploaded. Validation (not test) of `c1_s62`, 1 s windows: +cube position p95 8.4 mm, cube angle p95 4.1 deg (`nrd/c1_s62/complete.json`, `validation.json`). GPU runs do not +repeat bit for bit: a re-run gives a similar, not an equal, checkpoint. + +## What the files contain + +- `nrd_data/*/unified_data.npz`, `nrd_test/unified_data.npz` (uncompressed): `arm` [N, 601, 12] (6 joint angles, 6 + joint rates), `cube` [N, 601, 13] (position, quaternion, velocity, angular velocity), `action` [N, 601, 6] (joint + position targets), `contacts` [N, 600, 3] (fixed jaw-cube, moving jaw-cube, cube-table), `lengths`, `splits` (0 + train, 1 validation, 2 test), `family`, `phase`, contact force, impulse and depth, ids, seeds and outcome fields. + Records every 10 ms, 4 s episodes, CPU MuJoCo 3.15.0. `system.json` describes bodies, contact pairs, families and + physics; `manifest.json` gives the collector, seeds, counts, code and asset hashes. +- Teacher checkpoints: a state policy with privileged inputs (arm joints, cube state, goal). T0 outputs commands for + the scripted action decoder of the code; T2-T6 output joint targets. Student checkpoints: two ResNet18 image + encoders (external camera crop and wrist camera, 224 x 224 RGB) plus joint angles and rates; output a chunk of 10 + joint targets, 5 of them executed per query. + Both load with the code in `so101_pick_place/` of the NeDM main branch. +- `robot/logs//`: `session.json` (command line, typed outcome per episode), `first_frames.npz` (one 640 x + 480 frame per camera at the session start), `ep_NN/episode_live.json` (setup, guard, latency, outcome) and + `ep_NN/episode_live.npz` (50 Hz joint angles and commands, guard events, each policy query with its action chunk + and the student's two input images, saved at 112 px). +- `robot/videos/`: the student's own input images as logged (112 px; external | wrist), about 7.9 Hz, shown in real time. There + is no full-resolution or third-person video. + +## Status + +| Item | Status | +|---|---| +| Pinned revision | `hf_revision` in the code repository's copy of `release_manifest.json` (`so101_pick_place/release_manifest.json` on the NeDM main branch) | +| Main-compatible NRD files (`nrd/c1_s62/best.pt`, `nrd/c0_s62/best.pt`) | present. Check on CUDA: two 100-step rollouts (from the first state and from model step 100) of 64 validation episodes of each of the 4 data parts are bit-identical to the original file run with the training code, and the task metrics are equal (`release_manifest.json` -> `provenance.nrd.main_compatible_reports`) | +| Sealed NRD test (`nrd_test/`, 3,050 episodes) on `c1_s62` and `c0_s62` | run once, 2026-10-27, RTX 5090, main's `nedm.contact_nrd.test` unchanged: `results/nrd/`. 7 scored families, 1 s windows, cube position p95: base NRD 3.48 mm (validation 3.26), policy NRD 4.13 mm (validation 4.04) | + +## Download + +```bash +scripts/so101_pick_place/reproduce.sh smoke --steps download # in the code repository; checks size and SHA-256 of every file +``` + +Or with `huggingface_hub`: `snapshot_download("harryzhang1018/NeDM", repo_type="dataset", revision=, +allow_patterns=["so101_pick_place/nrd/*", "so101_pick_place/student/*"])`. + +## Known limitations + +- One robot, one lab, one cube and one plate; the stress test took about 1 h. The camera calibration is specific to this camera + mount. +- The outcome is typed by the operator. The stress-test protocol was not fixed in advance, and the student was chosen + with robot results. +- L->R is weaker than R->L (63 % vs 83 %). Cubes near the base fail more often. +- Stages T1-T3 and the base NRD ran on uncommitted code: they are "recipe only". S0-S3 code commits are inferred. +- The robot logs do not record a checkpoint hash: the student of each session is known from the bundle folder named in + the logs and the study's local copy of that bundle; the files on the robot computer were not compared with + `MANIFEST.txt`. +- The NRD test set has only the scripted families; the policy NRD's own validation set (19 families, with the + expert, noisy-command and policy episodes) has no test counterpart. The robot logs hold lab background images, the robot computer's user + path (`/home/sbel`) and the USB adapter serial; the code snapshots in `provenance/` hold cluster home paths. + +## License and citation + +BSD-3-Clause, the same as the rest of the dataset. The MuJoCo Menagerie SO101 model is not hosted here; the code +fetches it at a pinned revision. Please cite the NeDM paper and name the dataset revision you used. diff --git a/so101_pick_place/bundle/so101_hw_v13_tb10.tar.gz b/so101_pick_place/bundle/so101_hw_v13_tb10.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..16df222b6a8c4060a8d664221d22795b7cb7a7d1 --- /dev/null +++ b/so101_pick_place/bundle/so101_hw_v13_tb10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a229cddccc8a683da0083dc981ab4bc9faf7515285eb8726cea6b909e01522c +size 23280447 diff --git a/so101_pick_place/bundle/so101_hw_v13_tb10/MANIFEST.txt b/so101_pick_place/bundle/so101_hw_v13_tb10/MANIFEST.txt new file mode 100644 index 0000000000000000000000000000000000000000..6fc5a1ab58dab9b62c8595792b1776e785beec06 --- /dev/null +++ b/so101_pick_place/bundle/so101_hw_v13_tb10/MANIFEST.txt @@ -0,0 +1,42 @@ +built 2026-10-27T09:32:46-05:00 from /home/harry/.t3/worktrees/NeDM-push-ppo/r2s-v12-vis (git 2b6dc4d8d 0 changed files under the copied paths) +student /home/harry/so101_r2s_claude/ckpt/v12/students/v12_tb10_s1210/it_01000.pt (floor mode flat, assets/deploy.json) +calib /home/harry/so101_r2s_claude/calib/calib_v1.json +3b7a2124d1b56bd6049a682a4eb29e9f4cef62818f4a420665171bbe31e0410f ./assets/calib_v1.json +d29074110d67a79c003c4e324bf4a9dcc75273f5381ca09a72e58dd4d104deaf ./assets/deploy.json +32dcf834a1dc3d31b1e6082bf0f2f6c80056861bd97a8856b0d8e4f733365f64 ./assets/kin_points_v1.npz +6458a4f791d1052148bb8f7621413259342a7018757668fde244cfc098f99f5c ./assets/student.pt +87becae0ad0bb8bb1af7a79e4e4c91361f053f7478d405cb0fa75c05ca4e970f ./QDGAIN_TEST.md +313e5d82a11f3a38dec96cdd052900d332dda7a87b427612cc0296159c4c46b4 ./robot_test.sh +958cc71178723cc352f21114d0ec58d5862f682c51decdd199a0a04b0844fb16 ./scripts/so101_policy/real2sim/hw/hw_lib.py +bf635927181c43646541ea968892f23e0cd2412fb52f64a035ff2418d865d600 ./scripts/so101_policy/real2sim/hw/README.md +90c629574ac17579ce2cdfa7baf975985c34c7d95cbf2fad3519288fde9700c4 ./scripts/so101_policy/real2sim/hw/run_student_real.py +0b92e78ad52036c9e3c282ced58aadf360940c587b126ce5b4bb8a1974cfad12 ./src/nedm/__init__.py +1f2093327df62a87f0759bf19648ae088ccfd5ae9a16d2f6a053cd74c5223ba9 ./src/nedm/render/student_view.py +c2b3b99c67c8b91597d426fb0f5c6ef502b22e993def9f493032c13fd96c15c5 ./src/nedm/so101_policy/cube_symmetry.py +8c606bd4c25b3f19fbe89aa48c87df3e6ab0105c399d483e4bd39eb7159e1fc0 ./src/nedm/so101_policy/data_round.py +fddfa91c60ca78e937e3dddc48d0c43fefb7b304b4d32d61b2c5762025b90640 ./src/nedm/so101_policy/decoder.py +ae0129f3678ca6a9e7df2bfda46411c3eec2a1d449ac0c83b7796e3c22e9ab84 ./src/nedm/so101_policy/expert.py +9f3d9faf9d8c2b7874f9b4f4cb80b05bf828a5ea6e83c2b3cf4a05bc9d3649f3 ./src/nedm/so101_policy/__init__.py +549c84a5856f293b8a2b95fdfffd761238e5d796250c1f007771ad1a29b0a2e5 ./src/nedm/so101_policy/joint_env.py +4e4b439ddd6934d31fe23d23852923c2df41b64e83f15faf591e346ff3beba9e ./src/nedm/so101_policy/joint_teacher.py +20388d992ffaf8f1e49b2a3e1bb1e6b0fadf39b0d292019c9aa3e945e4a44d4d ./src/nedm/so101_policy/kin.py +390a57f15430954bca16ee1fd5c8e4f1250dc581972677c3e821a92a5f060514 ./src/nedm/so101_policy/kin_world.py +416500a0101034fa64ef8f338c0072b4c51871e8e0cf52be01cbcdb0c45952cd ./src/nedm/so101_policy/mjwarp_env.py +9c2daf8375068f07a5a3989a5e19d76c0f35ec9aee09c894634e6cd875f11dbc ./src/nedm/so101_policy/mujoco_env.py +bc7a402a66b30092b7e1549f8484677cea9d0988e2846bae64a1bca22350e682 ./src/nedm/so101_policy/nrd_sim.py +b026e361f0f285112000d6533770d5478b2e6a11a3885b65af4af8d9f41118be ./src/nedm/so101_policy/ppo.py +70eeb69db57d6c58fb2028e6f51aff214a17337dd11ef8bd86bf0dc45cb136c9 ./src/nedm/so101_policy/table_bias.py +9e8f1a316dfc404aa1e921e65031f09b282a7ebfbf199207161157872d08e638 ./src/nedm/so101_policy/table.py +bf05c91dfc0090fef3203e1704b788930e7412832e6974c39088893b812d033b ./src/nedm/so101_policy/task.py +deedc6239b51ffbbc86dfecd066135bb7323dfd3cb50f7eb2aadecf4e2d163eb ./src/nedm/so101_policy/vec_env.py +731ca7508aa6348d5947eb30349f5701f651e3e655ca78fcd43d52b79d8d0f5b ./src/nedm/so101_policy/vision/act7.py +f9537fa7607b70857cd30083c94488156cc76b1bd642a4d80965a2f29c7333af ./src/nedm/so101_policy/vision/dataset.py +dcd6af52209c8e47ffd46286aa3f2a37641c3464740425bc20f0f20c5630cdbf ./src/nedm/so101_policy/vision/demos.py +61fc1f756e386e006acf692806a94c828857754c43516ba6fa8c559a06bd04d0 ./src/nedm/so101_policy/vision/__init__.py +76caa665585b33e83ed8baa69232e4cd5cc1d99ad2011f555250cda0c39dc7fb ./src/nedm/so101_policy/vision/perstep.py +600df4aa64f3baf86ce7cc43acc8d9d4eb784bf28de50f405e7a8a3a0fbc479b ./src/nedm/so101_policy/vision/rollout.py +686e3813a933fc9e3a56c4365b12b32d5c84b768e6411ca24795eeac21dc27f8 ./src/nedm/so101_policy/vision/student.py +bb2c80ce5b2c4c6a08d3a6ac7c145b9652c33e5f094d3046b518061f0babceb3 ./src/nedm/so101_policy/vision/teacher.py +ab7cbe9d052a069936780c29c32df5a2bf907778e65b50e332b67ca1b2fcd8fd ./src/nedm/so101_policy/vision/tray.py +c0708f0ad8a254badedb4ccb2a4af99c7515e3467327f7b2f63973a846fcb957 ./src/nedm/so101_policy/vision/viral.py +8650e24eca6a19d2c0a578822b4ce0cd63daddcc216ebdd43e9f27742d44e576 ./src/nedm/so101_policy/world.py diff --git a/so101_pick_place/bundle/so101_hw_v13_tb10/QDGAIN_TEST.md b/so101_pick_place/bundle/so101_hw_v13_tb10/QDGAIN_TEST.md new file mode 100644 index 0000000000000000000000000000000000000000..c784856417390bae229f2fd11277d4519df3d48c --- /dev/null +++ b/so101_pick_place/bundle/so101_hw_v13_tb10/QDGAIN_TEST.md @@ -0,0 +1,98 @@ +# Robot test: joint-speed input gain (`--qd-gain`) + +Written 2026-10-22 evening for an agent that guides the user at the SO101 robot (proxy, Jetson AGX Orin). The user runs +every command at the robot. The agent explains, reads the outputs and the logs, and keeps the rules below. + +## 1. Why this test + +| Item | Value | +|---|---| +| Robot result on 2026-10-22 (today's student, `eval`) | Grasp and lift 12 of 12; release 2 of 12. The arm holds the cube still 1-5 cm above the plate and never opens the gripper. | +| Cause (found in the sim) | The student sets its step size from the MEASURED joint speed. The real arm is about 5 times slower than the sim arm. So near the plate the steps get smaller and smaller, and the arm stops. | +| Sim proof (today's student, robot-like sim, 48 episodes) | Joint-speed input x 0 / 1 / 2 / 3 / 4 / 5: success 10 / 50 / 88 / 94 / 83 / 48 %. At 5 the arm hits the table. | +| Same, normal-speed sim | x 1 / 2 / 3: 98 / 90 / 75 %. A high gain makes a FAST arm too aggressive. The real arm is slow, so 2-3 should fit. | +| What `--qd-gain g` does | Multiplies only the student's joint-speed input by g. The safety guard and the logs keep the measured speed. All other settings are the same as `eval`. Default 1 = today's behaviour. | + +The gripper decision itself does not change: the student must first get low enough. If the gain works, the arm keeps +moving down to the plate and the student releases as in the sim. + +## 2. Rules (must) + +1. The user runs all commands. The agent does not run `dry`, `live` or `eval`, and does not open the robot port or + the cameras. +2. Never write motor EEPROM, never recalibrate, never run LeRobot tools (`lerobot-calibrate`, `lerobot-setup-motors`, + `lerobot-teleoperate` ...) in this test. +3. Keep a hand near the arm. Stop keys: space, q, Esc or Ctrl+C. After a stop the arm holds (torque on). +4. Stop the test and lower the gain if the arm hits the table, presses the cube into the table, or oscillates. +5. Do not change files in `~/so101_hw_robot` (the launcher refuses changed files). + +## 3. Before the first episode + +1. `cd ~/so101_hw_robot && ./robot_test.sh check` must end with `CHECK OK`. The first line under "bundle files" + must name git commit `bbcf9f792` or later (the commit that added `--qd-gain`). +2. Start from the folded rest pose. In the `q real` line of the run output: the 2nd value (shoulder lift) must be + between -88 and -100, the 3rd value (elbow) between 80 and 90. Else the run refuses (move the arm by hand with the + torque off, then start again). +3. The wrist camera cable must have slack for a wrist roll of about 76 deg real (HOME turns the wrist; since 10-24 HOME + has sim roll 0 = 75.8 deg real, before 120.8 deg; the cable pulled out once on 10-22). +4. The cameras must stay in their USB ports (external = port 4.1.4, wrist = port 4.1.1). The script uses these paths. + +## 4. Test plan + +Use the layout that worked on 10-22 for most episodes (from behind the robot, looking where the arm points at HOME): +green cube 16 cm forward of the shoulder axis and 7 cm to the right; red mat 19 cm forward and 7 cm to the left; both +square to the forward direction. Also use the mirrored layout (cube left, mat right) and 2 other layouts inside +15-27 cm from the shoulder axis. + +| Block | Command | Episodes | Layouts | +|---|---|---|---| +| A | `./robot_test.sh eval 4 --qd-gain 2` | 4 | 2 x working layout, 2 x mirrored | +| B | `./robot_test.sh eval 4 --qd-gain 2.5` | 4 | same 4 layouts | +| C | `./robot_test.sh eval 4 --qd-gain 3` | 4 | same 4 layouts, only if A and B had no table contact | +| D (optional) | `./robot_test.sh eval 4` (gain 1, reference) | 4 | same 4 layouts | + +Episode limit: 40 s (the default of `eval`). A typical successful episode on 10-22 took about 22 s. + +Each episode: +1. At HOME, place the cube and the mat, then type `RUN`. +2. Watch the arm. Push space when the cube is on the mat and the arm has moved away, or at a failure. +3. Type the result: `g` grasp, `l` lift, `p` placed on the mat, for example `glp`, or `-`. Add a short note after a + space, for example `glp clean`, `gl hover 2cm`, `gl dropped high`, `g- slipped`, `table contact`. +4. Type `r`: the arm goes back to HOME (the gripper opens). Reset the scene. + +At the end of a block: type `s`, then in the menu `r` (return to the start pose, slow), then `t` with a hand under the +arm (torque off), or `h` to keep holding. + +## 5. What to watch for + +| Sign | Meaning | Action | +|---|---|---| +| The arm goes down onto the mat and opens | The fix works | Continue | +| Hover 1-5 cm above the mat, no release (as on 10-22) | Gain too low | Next block (higher gain) | +| The gripper touches the table during the approach or the place | Gain too high | Stop; go back to the lower gain | +| Fast jerky motion or oscillation | Gain too high | Stop (space); lower the gain | +| "guard: command floor" or "measured floor" stop | The guard stopped a low command | Note it; if it repeats, lower the gain | +| Camera error / "frame ... old" stop | Cable or USB problem | Check the wrist cable; `ls /dev/v4l/by-path/` must show 4.1.1 and 4.1.4 | + +## 6. What to send back + +- The session folders: `~/so101_hw_runs/eval__