# Parametric modular fidex robot — package

A clean parametric modular robot arm built from the LOCKED base parts + a fiducial (ArUco)
exoskeleton, reproducing smith300's rough shape. Everything = `f(holder, yoke, connector, chain, fidex)`.

## Regenerate everything
```
bash build_all.sh        # holder -> yoke -> fidex holders -> arm URDF+config -> ArUco boards -> print sheet -> hero
```

## Source of truth (parts)
- `wrap_holder.py`  — LOCKED both-sides STS3215 servo holder. Clearance via `voxel_trim.py <mm>`
  (uniform voxel-dilation gap; OCP offset can't inflate the geared servo). Fallback: `python wrap_holder.py` (Minkowski).
- `yoke_exact.py`   — LOCKED yoke (grips horn+idler). `gen_yoke_arm.py` exports the 45mm connector `yoke_arm.stl`.
- `fidex_holder.py` — parametric ArUco marker holder bracket (recessed board pocket). 15mm + 50mm.

## Assembly + fidex
- `param_arm.py` -> `smith300_modular.urdf` (8 links, 6 revolute + fixed gripper, base-on-table) +
  `fidex_config.json` (per-link `aruco_offset_pos_mm`/`rot` = the CAD<->vision LinkConfig coupling).
  Params: ARM_YOKE_LEN, BENDS, ROOT_RPY, FIDEX*, N.
- `gen_markers.py` -> `fidex_markers/L0..L6.png` (real ArUco boards: base 3x3 ids0-8 @50mm, shoulders
  2x2 ids20-43 @15mm, DICT_4X4_250) matching the pockets.
- `gen_print_sheet.py` -> `fidex_print_sheet.png` (A4 300dpi true-scale + 50mm calibration square). Print at 100%.

## Render / verify
- `render_arm.py <urdf> <out> [q]` (4-view), `render_hero.py <urdf> <out> [az el q]` (single),
  `render_sweep.py <urdf> <out>` (joint sweep + self-collision count; verified 0 contacts).
- Viewer: `cad.omidlab.net/?dir=/data/cameron/repos/smith300_para_stuff&file=smith300_modular.urdf`

## Notes
- Clearance is TUNABLE (Cameron to print + verify fit before freezing).
- MuJoCo/viewer don't render PNG marker textures; markers are delivered as the print sheet + PNGs.
- Deps in `.venv_cad`: build123d, cadquery-ocp, ezdxf, trimesh, manifold3d, scikit-image, opencv-contrib (numpy/scipy).
