# Gripper testing — iteration log (path B, parametric, STANDALONE)

**Scope:** standalone thumb gripper on ONE servo. Files: `gripper_gen.py` (parts + URDF), `gripper_render.py`
(open/closed render), `gripper_testing.urdf`, `thumb.stl`, `fixed_jaw.stl`. Reuses `st3215.stl` +
`holder_approx_drilled.stl`. **DO NOT touch the main arm pipeline** (`gen_two_servo.py`, `apply_glb_layout.py`)
or wire this into the arm — Cameron wants it kept separate for now.

**Frame:** servo output axis +Y through (X=-25.5, Z=0); horn +Y face (Y=9.6), idler -Y (Y=-28.2). Fingers
extend -X, close in Z (rotation about +Y). Flush-at-closed is automatic (both fingers authored at closed pose).

**Run:** `venv_cad python gripper_gen.py && MUJOCO_GL=egl mujoco-venv python gripper_render.py gripper_testing.urdf out.png`
(cad venv: `/data/cameron/repos/cad_experiments/.venv_cad/bin/python`; mujoco venv:
`/data/cameron/repos/custom_robot_building/.venv/bin/python`). All exec via `ssh cameronsmith@100.74.71.38`.

## Status
- **v1:** kinematics VALIDATED — thumb rotates about the output axis, closes flush-parallel onto the fixed
  jaw at jaw=0, opens ~52° at jaw=0.9. Crude boxes. `gripper_v1.png`.
- **v2 (fin-ray):** rigid thumb box -> parametric FIN-RAY triangle (TPU), `FINGER_STYLE="finray"`, shapely
  extrude of (hollow triangle + angled ribs). `gripper_v2_finray.png`. shapely was installed into cad venv.
- **v3 (front-plane + collision):** KEY FIX — fingers moved to a plane IN FRONT of the servo face (Y=11..31,
  beyond body max Y=9.6) so they clear the body; fixed-jaw bracket routed in front of the body then UNDER it
  (Z<-12.4) to the holder. Collisions now: fixed_jaw-vs-servo **False** (was True), thumb-vs-fixed **False**.
  Remaining are INTENDED contact: thumb-vs-servo = clamp gripping the horn (-> real mount, #2); fixed-vs-holder
  = overlap to be unioned (#3). Both parts **watertight**. Closed gap = GRIP_GAP=4mm; opens ~52°. `gripper_v3_front.png`.
  Collision tool: `gripper_collision.py` (python-fcl).
- **v4 (real horn mount):** replaced the crude clamp with a REAL horn plate — `_horn_plate()` drills the exact
  STS3215 4-bolt pattern `HOLES_XZ=[(-32.5,0),(-25.5,±7),(-18.5,0)]` (BOLT_D=2.9) + center bore (BORE_D=9) on a
  plate at the horn face (Y=9.6..15), from `yoke_exact.py`. Thumb = fin-ray + plate + gusset **boolean-unioned**
  (manifold) -> watertight. Fixed-jaw finger moved to X<-40 to clear the plate. Collisions: only intended
  (thumb↔horn plate = the bolted mount; fixed↔holder = to be unioned). Both parts watertight. `gripper_v4_horn.png`.
  Aperture: closed gap = 4mm; ~52° open swing -> ~40mm at the fingertips (fine for ≲40mm objects).
- **v5 (base union + V-groove) — CLEAN PRINTABLE:** fixed jaw boolean-UNIONed into the holder ->
  `gripper_base.stl` (one body, 23cm3, watertight); added a V-groove along the fixed-jaw contact face
  (`PAD_STYLE="vgroove"`, cradles round objects, complements the wrapping fin-ray). Thumb clears the base.
  Two printable parts: `gripper_base.stl` (rigid) + `thumb.stl` (fin-ray). Both watertight, single-body,
  no unintended collisions. Aperture 4mm->~30mm (mid-finger) / ~40mm (tips). `gripper_v5_base.png`.

## DESIGN DIRECTION — FIN-RAY TPU finger (Cameron 2026-07-02, likely the way to go)
Cameron wants the **moving finger (the "thumb", driven by the servo output) to be a compliant FIN-RAY finger
printed in TPU** — a triangular finger (spine + front contact edge + angled internal ribs) that deforms to
WRAP around objects when pressed. Just **ONE compliant side**: the fin-ray thumb closes against a **flat/rigid
fixed jaw** (the other side stays simple). Triangular, YAM-gripper style — simpler + better conforming than a
rigid box thumb. Terminology: thumb = moving finger on the output; fixed jaw = static side; gripper = whole EE.
- Keep v1's mount + kinematics + output-axis pivot; SWAP the rigid thumb finger for a parametric fin-ray triangle.
- Fin-ray params: finger length, base width, tip position, wall thickness (thin for TPU compliance), N ribs,
  rib angle/spacing. Mount base (horn clamp) stays rigid-ish; the compliant triangle is the contact finger.
- Print: TPU for the finger (compliant); the horn-clamp base can be the same TPU or a separate rigid mount.
- Reference the YAM gripper geometry if findable on the rig/repo; else fin-ray is a known parametric shape.

## TODO (prioritized — do the top one each iteration, then re-render + update this log)
- [x] **0. FIN-RAY thumb** — done v2 (`FINGER_STYLE="finray"`, fallback "box").
- [x] **1. Collision check** — done v3 (`gripper_collision.py`); front-plane fix cleared the body collisions.
- [x] **2. Real horn interface** — done v4 (`_horn_plate`, exact 4-bolt + bore; thumb union'd watertight).
- [x] **3. Holder union** — done v5 (`gripper_base.stl`, one watertight body).
- [x] **4. Contact pad** — done v5 (V-groove on the fixed jaw; `PAD_STYLE`).
5. **(deferred to Cameron)** Finger shaping: taper the thumb toward the tip (beak), tune FINGER_LEN / GRIP_GAP / FY span for a target
   object size. Compute grip aperture vs jaw angle and expose it.
6. **Parametric solve + report**: print grip aperture at open/closed, contact-pad flushness, watertightness of
   thumb/fixed, and a collision verdict each build.
7. **(later)** compare against SO-100 follower jaw profile at `/data/cameron/repos/SO-ARM100/STL/SO100/Follower/`.

## Open questions for Cameron (from GRIPPER_PLAN.md, still unanswered — assume defaults, note assumptions)
angular jaw (assumed) · grip aperture/object size (assume ~0-40mm) · rigid vs TPU pads (assume rigid v1) ·
thumb reuses yoke horn-grip vs dedicated adapter (assume dedicated boss on horn).

## Iteration history
- 2026-07-02 v1: built parts + URDF + render; kinematics confirmed.
- 2026-07-02 v2+v3 (cron iter 1): added fin-ray TPU thumb (shapely extrude); ran fcl collision check ->
  found ALL parts intersecting the servo body (fingers straddled Z=0 where the body is). Fixed by moving the
  finger plane IN FRONT of the servo face (Y=11..31) + routing the fixed-jaw bracket under the body. Result:
  no unintended collisions, both parts watertight. **Next: #2 real STS3215 horn interface on the thumb**
  (the "precise mating" ask), then #3 union fixed-jaw into holder. Also consider: fin-ray finger looks a bit
  tall (FR_H=16) & the front-plane offset makes the thumb cantilever off the horn — may want a stiffer clamp/
  a rigid base segment before the TPU fin-ray, and to verify the clamp actually captures the horn boss.
- 2026-07-02 v4 (cron iter 2): built the REAL STS3215 horn mount (exact 4-bolt pattern + 9mm bore drilled into
  a horn-face plate, from yoke_exact); thumb = fin-ray + plate + gusset boolean-unioned -> watertight; moved
  the fixed-jaw finger to X<-40 so it clears the plate. No unintended collisions; both parts printable.
  **Next: #3 union the fixed-jaw bracket into the holder** (one printable base part) + #4 contact pads. Note:
  the fin-ray base (TPU) bolting straight to the horn may be too floppy at the mount — consider splitting into
  a RIGID horn adapter (the plate, printed rigid) + a separate TPU fin-ray that clips/bolts onto it (2 materials).
  Getting close to a clean printable gripper — ~1-2 more iterations (holder union + pads) then wind down.
- 2026-07-02 v5 (cron iter 3): unioned fixed jaw into holder -> `gripper_base.stl` (one watertight body);
  added a V-groove to the fixed jaw. Two printable watertight parts, no unintended collisions, kinematics +
  aperture verified. **WINDING DOWN** — reached a clean printable gripper. Stopping autonomous changes;
  cancelled the 30-min cron.

## WINDING DOWN — summary for Cameron
Working parametric fin-ray gripper, standalone (`gripper_gen.py` -> `gripper_base.stl` + `thumb.stl` +
`gripper_testing.urdf`; view/verify with `gripper_render.py` + `gripper_collision.py`). Real STS3215 horn
mount (exact 4-bolt + bore), compliant fin-ray TPU thumb, V-groove fixed jaw unioned into the holder, both
parts watertight/single-body, no unintended collisions, ~52° swing, 4->~30-40mm aperture.

**Key decision left for you (why I stopped here):** the thumb is currently ONE part = horn plate + fin-ray.
For real TPU compliance the *finger* wants TPU but the *bolted horn plate* wants to be rigid. Two options:
(a) print the whole thumb in TPU (simplest; plate may be a bit floppy — often fine with 4 bolts + thick plate),
or (b) split into a RIGID horn adapter + a TPU fin-ray that bolts/clips onto it (2-material, stiffer mount).
Tell me which and I'll build it. Also open (from GRIPPER_PLAN.md): target object size / aperture, jaw
angle range, and whether to also compare against the SO-100 follower jaw profile.
