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

Migrated from github.com/Trevato/SO-ARM100

The table plane can be set: a tableOffsetMm setting and POST /settings/table-here from the arm's lowest point now #173

opened this

Merged 44d 8h ago

The virtual table can now be moved with a tableOffsetMm setting, and POST /settings/table-here sets it from the arm's lowest link. server.test.ts passes except one test, and I couldn't run the type check here.

Notes

opened this

The virtual table can now be moved with a tableOffsetMm setting, and POST /settings/table-here sets it from the arm's lowest link. server.test.ts passes except one test, and I couldn't run the type check here.

Test and check results

  • Failing test: "serves the model, its meshes and the vendored libraries" fails because node_modules is missing. bun install couldn't write to its tempdir in this sandbox, so I didn't investigate further. The forge's check should show whether it passes there.
  • Type check: bun x tsc --noEmit hit the same tempdir error, so it didn't run.
  • Other suites: kinematics.test.ts and relay.test.ts passed. I didn't run the rest of the suite.
  • Test added: it covers a 400 for an out-of-range or non-numeric tableOffsetMm, and checks that the resting pose has no violation after table-here.

What changed

  • Setting: tableOffsetMm lives in src/server.ts next to the other settings. It's validated to -100..100, returns a 400 outside that, and is persisted in settings.json.
  • Floor check: src/kinematics.ts now puts the floor at the model's floor plus the offset plus the floor margin. The status lowestMm and the closest-approach metric are measured from the offset table.
  • Table-here: POST /settings/table-here reads the joint positions and sets the offset to the lowest link's height minus the floor margin, rounded down. That puts the margin line at or below the lowest link, so the resting arm isn't flagged.
  • Admin only: I added the route to ADMIN_ONLY in src/relay.ts. The relay already enforces same-origin for mutations, and the arm server has no auth of its own.

Not done: the 3D viewer still draws the table at the model's own floor, because the issue didn't ask for the viewer to follow the offset.

🤖 Generated with Claude Code

Closes #162

commented

The virtual table can now be moved with a tableOffsetMm setting, and POST /settings/table-here sets it from the arm's lowest link. server.test.ts passes except one test, and I couldn't run the type check here.

Test and check results

  • Failing test: "serves the model, its meshes and the vendored libraries" fails because node_modules is missing. bun install couldn't write to its tempdir in this sandbox, so I didn't investigate further. The forge's check should show whether it passes there.
  • Type check: bun x tsc --noEmit hit the same tempdir error, so it didn't run.
  • Other suites: kinematics.test.ts and relay.test.ts passed. I didn't run the rest of the suite.
  • Test added: it covers a 400 for an out-of-range or non-numeric tableOffsetMm, and checks that the resting pose has no violation after table-here.

What changed

  • Setting: tableOffsetMm lives in src/server.ts next to the other settings. It's validated to -100..100, returns a 400 outside that, and is persisted in settings.json.
  • Floor check: src/kinematics.ts now puts the floor at the model's floor plus the offset plus the floor margin. The status lowestMm and the closest-approach metric are measured from the offset table.
  • Table-here: POST /settings/table-here reads the joint positions and sets the offset to the lowest link's height minus the floor margin, rounded down. That puts the margin line at or below the lowest link, so the resting arm isn't flagged.
  • Admin only: I added the route to ADMIN_ONLY in src/relay.ts. The relay already enforces same-origin for mutations, and the arm server has no auth of its own.

Not done: the 3D viewer still draws the table at the model's own floor, because the issue didn't ask for the viewer to follow the offset.

🤖 Generated with Claude Code

commented

Four of the five review points are fixed. The page control and tty command (point 3) are deferred to follow-up issues instead. server.test.ts and lobby.test.ts pass except one test, which already failed before this round's changes. I didn't run the type check or the other suites.

  • Out-of-range table-here: POST /settings/table-here now answers 409 when the computed offset is past ±100 mm. The message gives the lowest link, its height above the model floor, and says to put the arm near the table first. It no longer reaches validateSettings.
  • Admin gate test: I put it in src/lobby.test.ts, not relay.test.ts. relay.test.ts has no lobby or identity setup, and the existing estop/settings gate test already lives in lobby.test.ts. It shows anonymous gets 401, a non-admin gets 403, and an admin gets 200. Deleting the ADMIN_ONLY entry in src/relay.ts would now fail it.
  • Offset moves the floor: a new server.test.ts case finds a forward lean that is refused with tableOffsetMm at 0. It then sets the offset to -100 and expects the same move to be allowed.
  • README: a new "table plane" paragraph documents tableOffsetMm, POST /settings/table-here and the 409.
  • Page control and tty command: I did not build these, and I disagree that they belong in this pull. src/tty.ts is the chat-room door and has no arm commands, so a tty command needs a design decision. Both are in #178, with the page control and button for the settings panel, and #179 covers the terminal.
  • Viewer table: the 3D viewer still draws the table at the model floor. #179 covers drawing it at the offset plane.

The test that still fails is "serves the model, its meshes and the vendored libraries". bun install couldn't write to its tempdir in this sandbox, so the vendored three.js files are missing.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs