Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

GET /servo-params on the arm server reports each joint's control registers, read-only #454

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

GET /servo-params now reports each joint's control registers, read-only, and the relay shows it to the owner only. The new tests pass. One existing test fails here: the model-routes test in src/server.test.ts gets 404 for /vendor/three/build/three.module.js (line 572).

Notes

shipped merged

opened this

GET /servo-params now reports each joint's control registers, read-only, and the relay shows it to the owner only.

The new tests pass. One existing test fails here: the model-routes test in src/server.test.ts gets 404 for /vendor/three/build/three.module.js (line 572). I didn't touch that route and didn't investigate. My guess is the vendored three.js isn't in this sandbox. I didn't run the full suite or the type check, because tsc can't find the bun types here.

  • Module: src/servo-params.ts reads Return_Delay_Time, the P/D/I coefficients, Minimum_Startup_Force, the CW/CCW dead zones and the two velocity-loop registers with one syncRead per register. It returns { id, joint, registers, error? } for every id. A silent servo is listed with error: "no answer", and one that answers only some registers gets error naming the missing ones.
  • Server: src/server.ts serves /servo-params, which is in the route list at the top of the file. It writes nothing to the bus. While anything drives the arm (a stream, move, playback, recording or park) it answers 409. The bus serialises its transactions, so a read cannot interleave with a frame already in flight.
  • Relay: src/relay.ts has a new OWNER_READS set next to ADMIN_ONLY. Non-owners, signed-in or not, get 404, and so does everyone when the relay has no lobby.
  • Tests:

- src/servo-params.test.ts covers the values coming back, a silent servo showing its error, and no write happening. - src/server.test.ts covers the route, no writes, and 409 while a stream drives. - src/admin-relay.test.ts covers the owner-only gate.

I didn't change fake-bus.ts; the test sets register values directly on the fake servo's memory.

🤖 Generated with Claude Code

Closes #442

commented

GET /servo-params now reports each joint's control registers, read-only, and the relay shows it to the owner only.

The new tests pass. One existing test fails here: the model-routes test in src/server.test.ts gets 404 for /vendor/three/build/three.module.js (line 572). I didn't touch that route and didn't investigate. My guess is the vendored three.js isn't in this sandbox. I didn't run the full suite or the type check, because tsc can't find the bun types here.

  • Module: src/servo-params.ts reads Return_Delay_Time, the P/D/I coefficients, Minimum_Startup_Force, the CW/CCW dead zones and the two velocity-loop registers with one syncRead per register. It returns { id, joint, registers, error? } for every id. A silent servo is listed with error: "no answer", and one that answers only some registers gets error naming the missing ones.
  • Server: src/server.ts serves /servo-params, which is in the route list at the top of the file. It writes nothing to the bus. While anything drives the arm (a stream, move, playback, recording or park) it answers 409. The bus serialises its transactions, so a read cannot interleave with a frame already in flight.
  • Relay: src/relay.ts has a new OWNER_READS set next to ADMIN_ONLY. Non-owners, signed-in or not, get 404, and so does everyone when the relay has no lobby.
  • Tests:

- src/servo-params.test.ts covers the values coming back, a silent servo showing its error, and no write happening. - src/server.test.ts covers the route, no writes, and 409 while a stream drives. - src/admin-relay.test.ts covers the owner-only gate.

I didn't change fake-bus.ts; the test sets register values directly on the fake servo's memory.

🤖 Generated with Claude Code

Approved

Read-only, owner-gated through the relay (404 for everyone else, including when there is no lobby), 409 while anything drives, no bus writes, and a test for each of the three behaviours. The preview answers 404 to an anonymous request, as the gate intends. Small module, no new dependency, route documented in the server.ts header. Two things next: (1) run tsc and the full suite once with the bun types installed. The vendored-three 404 smith reported is probably the sandbox, but the forge check has the final say. (2) A syncRead failure is swallowed into a blank register; record the thrown message in the row error so the owner can tell a bus fault from a silent servo.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs