Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
/admin shows each joint's servo control registers in one read-only table #472
Merged 42d 12h ago
/admin now has a Servos section. It shows one row per joint and one column per register, with the arm's GET /servo-params read on the server each time the page loads. I ran the whole Software/so101 test suite (755 pass).
-
Reviews
Changes requested — before the latest pushThe table, escaping, owner-only gating and tests are sound. Two items on the list are missed.
- README: nothing says the owner's /admin now has a read-only Servos section. The existing "Tuning the servos" section in Software/README.md (around line 937) lists GET /servo-params; add a sentence there saying where the owner sees it on /admin and when it shows a sentence instead (409 while someone drives, arm unreachable). Fix this first.
- Both doors: src/tty.ts is untouched, so the owner can read the registers on the page but not in the terminal. Either add the same owner-gated read to the terminal (using readServos for the same parsing, and a test that a guest sees nothing), or state in the pull why the terminal has no admin view. If the second, say so in the README.
Smaller: the preview /admin returned 404 to me without identity, which is expected, so I could not see the table as the owner; the unit and relay tests cover it.
ApprovedOwner-only read-only Servos table on /admin plus /servos in the terminal. Every arm-supplied value is type-checked, length-capped, stripped of control characters and escaped. The relay gates the owner, and the tests cover a 404 for non-owners. The 409 sentence, the per-row errors and the terminal door are covered too. The README is updated. The preview answers 404 to an anonymous /admin, as expected, but I could not sign in as the owner to see the table itself. Two things I would do next: (1) the /admin GET now waits up to 3 s on the arm for the owner, so load it after the page paints or cache the read for a few seconds; (2) add a short caption or wrapper note for narrow phones so the wide register table scrolls with a visible hint.
-
Checks
shipped merged
-
History
- Merge main into the servo registers pull 91d7b35
- Three table touches set the table: src/table-plane.ts fits the plane and POST /settings/table-touch applies it (#474) 2d712dd
- Merge main into the servo registers pull 56852ac
- Owner's /servos in the terminal, and the Servos section in the README f5e67e5
- /admin: a Servos section shows each joint's control registers, owner only 9cd3c6c
- Netcode for the arm: 25 Hz actual position, the page predicts the arm, intent and actual marks on every slider (#466) d419dd9
- POST /settings/joint-zero sets one joint's offset so the model reads a known mechanical reference (#463) e07bae9
- Refusals reach the page on /live, and the page reports its snap-backs with their cause to /precision (#468) 10e3bc7
- Phone: the camera and the 3D model span the full width again 3692913
- PUT /servo-params writes one joint's P/D/I and dead zones within safe ranges, only while nobody drives, and can put the factory values back (#461) abe3d6f
- The relay keeps the arm's first /servo-params read as the factory baseline under FORGE_APP_DATA, owner-only at GET /servo-params/factory (#462) 075a6c9
- Precision scorecard: tracking error, time to arrive, snap-backs with causes, per-hop latency - measured, shown, kept (#456) d7effd1
- STOP can lose to a command already in flight: the relay must drop what it holds, and the Pi must refuse commands older than its last STOP (#435) 930d8c0
- A zone block's depthMm matches the geometry: the impossible 'moving_jaw depthMm 177' is reproduced and fixed (#455) 82d611a
- forge.json: the app may reach the Pi's hardware H.264 camera sources (8091, 8092) a36051c
- GET /servo-params on the arm server reports each joint's control registers, read-only (#454) dd2c555
- A restart costs a blink, not a session: turn, queue and chat survive it and the page reconnects in under a second (#453) 6d19c12
- The page runs again: the notes cache is noteFallback, not a second top-level fallback 037dab0
- Frame age p95 and bytes per viewer for H.264 versus MJPEG are measured on the public URL and written in the README (#430) 2bd0103
- Tapping the presence line opens a list of who is here, the driver highlighted and guests with a colour dot; Escape or an outside tap closes it (#429) ac045d7
3 earlier comments
/admin now has a Servos section. It shows one row per joint and one column per register, with the arm's GET /servo-params read on the server each time the page loads. I ran the whole Software/so101 test suite (755 pass). I added servo-panel.test.ts for this, and it passes. bun x tsc --noEmit reports errors in other files, but none in the files I touched. src/web is untouched, so I did not run design-lint.
- Columns: they are whichever registers the arm returns, taken from its answer.
- Silent servo: its row shows its error text, and any missing register shows "—".
- Someone driving: a 409 shows the sentence "Someone is driving the arm, so the servos are not read now…".
- Other failures: an arm that is unreachable or answers with something unexpected gets a sentence too, never a blank table.
- Escaping: every value from the arm is cut to a safe length, stripped of control characters and HTML-escaped.
- Owner only: the section appears only for the owner. A moderator sees
/adminwithout it, and anyone else gets 404.
The page logic is in the new src/servo-panel.ts. src/relay.ts fetches /servo-params with a timeout of at most 3 seconds and passes it through src/admin-routes.ts to src/admin-page.ts.
The new tests cover the table from a fixture, including escaping and the per-row errors, and the 409 sentence. They also cover the owner-versus-moderator-versus-404 behaviour against a fake arm.
/admin has a read-only Servos section for the owner, and the terminal has a matching /servos command. I ran terminal.test.ts and servo-panel.test.ts, and both pass. The earlier full run had passed before the terminal change, and I did not rerun it.
- README: the "Tuning the servos" section in
Software/README.mdnow says the owner sees the registers in/admin's Servos section and as/servosin the terminal. It also says that while someone drives (the 409) or when the arm doesn't answer, both show one sentence instead of a table, and that moderators and everyone else see neither. - Terminal:
/servosprints one line per joint, with its registers and any error. It usesreadServosfor the same parsing as the page, andsrc/tty.tsnow wires it up. The owner sees the same sentences as on the page for a 409 or an unreachable arm. A guest gets "servos are for the owner", and a door without a reader says "not available here". A new test interminal.test.tscovers all of these, including control characters being stripped.
I only filter for the owner. /servos goes through the relay's owner-only GET /servo-params, so the 404 for non-owners comes from the server, not the terminal.
I merged main into the branch and pushed it. The only conflict was in src/terminal.ts.
I kept both sides in both places:
- Help text: it now lists
/zero <joint> [deg] (owner)frommainand/servos (owner)from this branch. Typedunion: it has thezerovariant and theservosvariant.
terminal.test.ts and servo-panel.test.ts pass (38 tests), and tsc reports nothing in the files I touched. I did not rerun the full suite after the merge, so the rest rides on the forge's check.
I merged main into the branch again and pushed. The conflict was in src/terminal.ts, in the same two places as last time.
- Help text: I took
main's version, which now has/table here|touch 1|2|3|<mm>, and kept/servos (owner)in it. Typedunion: I tookmain'stablevariant, which now allows{ touch: 1 | 2 | 3 }, and kept theservosvariant.
terminal.test.ts and servo-panel.test.ts pass (39 tests), and tsc shows no errors in the files I touched. I did not rerun the full suite after the merge, so the rest rides on the forge's check.
/adminnow has a Servos section. It shows one row per joint and one column per register, with the arm'sGET /servo-paramsread on the server each time the page loads. I ran the wholeSoftware/so101test suite (755 pass). I addedservo-panel.test.tsfor this, and it passes.bun x tsc --noEmitreports errors in other files, but none in the files I touched.src/webis untouched, so I did not run design-lint./adminwithout it, and anyone else gets 404.The page logic is in the new
src/servo-panel.ts.src/relay.tsfetches/servo-paramswith a timeout of at most 3 seconds and passes it throughsrc/admin-routes.tstosrc/admin-page.ts.The new tests cover the table from a fixture, including escaping and the per-row errors, and the 409 sentence. They also cover the owner-versus-moderator-versus-404 behaviour against a fake arm.
Closes #443