added board control

This commit is contained in:
PROFERIS - Mi³osz Stocki
2026-07-07 09:34:00 +02:00
parent 7a216ea645
commit 2e74c7d0c1
13 changed files with 731 additions and 48 deletions
+6 -4
View File
@@ -375,10 +375,11 @@ The `?v=Date.now()` on imports handles this automatically on page load.
The router currently only has two routes. These sections need to be created:
### `board-control` section (not started)
- Full keyboard layout overlaid on a top-view board image
- Click a letter/number → IK move to `LOOKUP_TABLE[char]`
- Perhaps a "type a word" sequential move feature
### `board-control` section (implemented)
- Uses predefined background maps (SVG/PNG) with corresponding JSON config files specifying clickable coordinates in physical mm.
- Click a spot on the map or select from a compact list → IK move to coordinates.
- Supports movement modes (e.g., Direct, Erratic, Random, Snaky).
- Requires arm to be homed; homing state is persisted across sessions via `localStorage`.
### `sequence-editor` section (not started)
- Record and replay a sequence of moves
@@ -407,6 +408,7 @@ To add a new section:
| **No dynamic BLE imports**| `index.html` must import `ble.js` via static `import`. Dynamic cache-busters create multiple instances of the BLE singleton, isolating UI event listeners! |
| **`fivebarIKGame.js` is reference only** | The original site's game uses a different angle convention (absolute degrees, different home, with `ikElbowSigns` tracking). We use the C++ IK formula instead because it directly produces step deltas from home. `fivebarIKGame.js` is kept in the repo for reference and understanding, not imported. |
| **Hash-based routing** | Keeps the SPA working from `file://` and simple static servers without needing a history API setup |
| **Persistent Homing State** | The UI uses `localStorage.getItem('wiji_homed')` to track if the arm has been homed during the user's ongoing interaction. This avoids forcing the user to re-home every time they switch tabs or pages. Sending `HOMEALL` sets this to `true`. |
---