Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
TOP: the joint sliders follow your finger and stay where you put them - no snapping back #68
The sliders and the 3D model now stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31). Why it snapped back.
stopped closed without shipping deploy 3856ad9
5 earlier comments · 1 event
The sliders and the 3D model now stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31).
Why it snapped back. Since #31 the arm server moves a stream at no more than 90°/s. When the stream closes, or goes quiet for 1 s, it holds the arm wherever the arm happens to be. The page closed its stream 250 ms after you let go, so the arm stopped part-way. The page then copied that position back into the slider and the model. Method: a probe drags a slider 1200 ticks in 0.3 s through the relay and lets go. Run twice on each app commit: from #4 to caa4fc0 the arm ends on the target (3248) every time. From f5d990e on it stops near 2565–2605. The server's own streaming was never broken; a slow drag arrives mid-drag at every commit, over a fast or a 200 ms link.
The fix is in the page, and the server's safety limits stay as they are.
- One hold per joint, shared by the slider and the model (
src/ui/joint-hold.js). While you hold a control, pose updates never move it. After you let go it keeps showing your target until the arm gets there, or until the arm has stopped closing in for 2 s (a jam, a limit, the safe zone). That way a slow arm doesn't snap the control back. - The page keeps the stream open until the arm arrives. Every 250 ms (inside the 1 s dead-man) it re-sends targets the arm hasn't reached, and held ones too, so a finger resting mid-drag doesn't let the arm stop. It never opens a stream to do this. A stop or a refusal clears every pending target, so nothing is sent later.
- Live while dragging: every
inputand every modelangle-changeis sent, at most 30 a second, latest value winning (src/ui/frame-pacer.js), and the value label updates as you slide. - Two marks per slider: blue for your target, amber for where the arm is. When idle, the thumb is the arm's real value. On the model, the joint you drag stays where the pointer puts it, and a faint amber ghost shows the real arm following.
- Refusals in words beside the controls (
src/ui/drive-gate.js): "Join the queue to drive", "It's not your turn", "Arm offline - reconnecting", "Stopped - resume first". The controls are always shown, greyed out when you can't drive. - The owner can always drive: their first command takes control (
src/lobby.ts). - The offline simulation is never driven while an arm server is set: commands get 503 and
/followcloses with 1013, saying "reconnecting".
Tests. The type check passes, and I ran the full suite at my first commit (306 pass). The suites my later changes touch pass (118: src/ui, relay, admin-relay, server, lobby). The issue's four tests are in: a 30 Hz pose stream (including a fall to 2048) doesn't move a held slider, a refused stream shows its reason, the owner drives with no queue, and the offline simulation can't be driven.
Other tests added:
relay.test.ts, the bisect probe kept as a regression test: with the server's real timings, a flick-and-let-go ends within 15 ticks of the target, and without the keepalive it stops more than 300 short.- Also in
relay.test.ts: the arm moves during a drag, not only at the end. server.test.ts: the page's script parses, and every/ui/module it imports is served. It covers a slip in my own first commit on this branch, where an import namedshownclashed with one of the page's own and stopped the page loading. No existing test was changed.
Not done:
- Sequence numbers and timestamps on commands are #66's work (Quill, in progress); frames here keep their current format.
- No Playwright test against a real browser: the sandbox can't download one. The page's logic is tested as modules against the real server and relay.
- Not tried on the real arm or in a browser.
To try: on the preview, drag a slider quickly and let go. The thumb should stay put while the amber mark catches up with the blue one, then both marks disappear. On the model, drag a joint and let go: it stays, and the ghost follows. Signed in as anyone else, the controls are greyed out with the reason above them.
🤖 Generated with Claude Code
Main (#57, #60, #65) is merged into this branch. Sliders and the 3D model stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31).
Why it snapped back. Since #31 the arm server moves a stream at no more than 90°/s. When the stream closes, or goes quiet for 1 s, it holds the arm wherever the arm happens to be. The page closed its stream 250 ms after you let go, so the arm stopped part-way. The page then copied that position back into the slider and the model.
A probe found this. It drags a slider 1200 ticks in 0.3 s through the relay and lets go, run twice on each app commit:
- From #4 to caa4fc0 the arm ends on the target every time.
- From f5d990e on it stops 640–685 ticks short.
The server's own streaming was never broken.
The fix is in the page; the server's safety limits are unchanged.
- One hold per joint, shared by the slider and the model (
src/ui/joint-hold.js).
- While you hold a control, pose updates never move it. - After you let go it keeps showing your target until the arm gets there, or until the arm has stopped closing in for 2 s (a jam, a limit, the safe zone).
- The stream stays open until the arm arrives. Every 250 ms, inside the 1 s dead-man, the page re-sends targets the arm hasn't reached, and held ones too. It never opens a stream to do this. A stop or a refusal clears every pending target, so nothing is sent later.
- One pacer for everything. Sliders, the model, jogs and main's touch driving all go through main's
Frames(src/ui/frames.js): at most one frame per 33 ms slot, latest value winning. My ownframe-pacer.jsis gone and its drag test now runs againstFrames. The value label updates live. - Two marks per slider: blue for your target, amber for where the arm is. When idle, the thumb is the arm's real value. On the model, the joint you drag stays where the pointer puts it, and a faint amber ghost shows the real arm following.
- Refusals in words beside the controls (
src/ui/drive-gate.js): "Join the queue to drive", "It's not your turn", "Arm offline - reconnecting", "Stopped - resume first". The controls are always shown, greyed out when you can't drive. - The owner can always drive: their first command takes control (
src/lobby.ts). - The offline simulation is never driven while an arm server is set: commands get 503 and
/followcloses with 1013, saying "reconnecting".
Merge. Only src/viewer.html conflicted. The stream object keeps main's Frames and flush plus this branch's end(), which waits for targets not yet reached. The status poll does both jobs: it settles the joint holds, and it seeds main's touch driver, lets go of held thumbs when you can no longer drive, and shows the lag. Software/README.md merged cleanly.
Tests.
- The full suite passes (354) and so does the type check.
- The drag test from the old pacer had to change:
Framesopens its slot at the first send after the last frame went out. With an input every 8 ms that comes to about 25 frames a second, so the test now expects at least 24 frames per second of drag instead of 28. - New tests:
- The issue's four: a held slider ignores a 30 Hz pose stream, a refusal shows its reason, the owner drives with no queue, and the offline simulation can't be driven.
- In relay.test.ts: flick-and-let-go with the server's real timings (stops more than 300 ticks short without the keepalive, ends within 15 ticks with it), and the arm moving during a drag.
- In server.test.ts: the page's script parses, and every /ui/ module it imports is served.
Not done:
- Sequence numbers on commands are #66's work.
- No Playwright test: the sandbox can't download a browser.
- Not tried on the real arm or in a browser.
To try: on the preview, drag a slider quickly and let go. The thumb should stay put while the amber mark catches up with the blue one. On the model, drag a joint and let go: it stays, and the ghost follows.
🤖 Generated with Claude Code
Main (#69, fast on 4G) is merged into this branch, and the first visit is back under main's 50 KB budget. Sliders and the 3D model stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31).
Why it snapped back. Since #31 the arm server moves a stream at no more than 90°/s. When the stream closes, or goes quiet for 1 s, it holds the arm wherever the arm happens to be. The page closed its stream 250 ms after you let go, so the arm stopped part-way. The page then copied that position back into the slider and the model.
A probe found this. It drags a slider 1200 ticks in 0.3 s through the relay and lets go, run twice on each app commit:
- From #4 to caa4fc0 the arm ends on the target every time.
- From f5d990e on it stops 640–685 ticks short.
The server's own streaming was never broken.
The fix is in the page; the server's safety limits are unchanged.
- One hold per joint, shared by the slider and the model (
src/ui/joint-hold.js).
- While you hold a control, pose updates never move it. - After you let go it keeps showing your target until the arm gets there, or until the arm has stopped closing in for 2 s (a jam, a limit, the safe zone).
- The stream stays open until the arm arrives. Every 250 ms, inside the 1 s dead-man, the page re-sends targets the arm hasn't reached, and held ones too. It never opens a stream to do this. A stop or a refusal clears every pending target, so nothing is sent later.
- One pacer for everything: sliders, the model, jogs and touch driving all go through main's
Frames, at most one frame per 33 ms slot, latest value winning. The value label updates live. - Two marks per slider: blue for your target, amber for where the arm is. When idle, the thumb is the arm's real value. On the model, a faint amber ghost (
src/ui/ghost.js) shows the real arm following. - Refusals in words beside the controls (
src/ui/drive-gate.js): "Join the queue to drive", "It's not your turn", "Arm offline - reconnecting", "Stopped - resume first". The controls are always shown, greyed out when you can't drive. - The owner can always drive: their first command takes control (
src/lobby.ts). - The offline simulation is never driven while an arm server is set: commands get 503 and
/followcloses with 1013, saying "reconnecting".
Merge. Only src/viewer.html conflicted.
- My hold settling and the stop-or-reconnecting lock refresh now sit inside main's
applyStatus, which takes status pushed over/liveor polled. - The lobby keeps main's
statusSeenfield and my owner-awaremayDrive.
First-visit size. After the merge a first visit came to 55,048 bytes gzipped, over main's 50 KB budget. Main alone was already at about 49.2 KB. Two changes bring it back under:
joint-hold.jsanddrive-gate.jsnow load after the first view; until then the controls say "Loading the controls…". The ghost loads with three.js.- The page is sent without the whole-line
//comments of its script (src/page.ts), which saves about 4 KB gzipped on every first visit. The source keeps them. A test checks that the stripped script transpiles to exactly the same code as the original.
Tests.
- The full suite passes (370), the type check is clean, and the app boots:
/answers and every page module is served. - Two of my own tests changed:
- The page-script test now also covers modules imported when needed, since two of them are no longer imported up front. - The two relay drag tests now wait for the arm link to be live before driving. One had failed only under full-suite load: driving is refused until the link is live.
- New tests:
- The issue's four: a held slider ignores a 30 Hz pose stream, a refusal shows its reason, the owner drives with no queue, and the offline simulation can't be driven.
- In relay.test.ts: flick-and-let-go with the server's real timings (stops more than 300 ticks short without the keepalive, ends within 15 ticks with it), and the arm moving during a drag.
- In src/page.test.ts: the comment stripping.
Not done:
- Sequence numbers on commands are #66's work.
- No Playwright test: the sandbox can't download a browser.
- Not tried on the real arm or in a browser.
To try: on the preview, drag a slider quickly and let go. The thumb should stay put while the amber mark catches up with the blue one. On the model, drag a joint and let go: it stays, and the ghost follows.
🤖 Generated with Claude Code
Software/README.md was committed with unresolved merge conflict markers (<<<<<<< HEAD, =======, >>>>>>> origin/main). The README is the "how to use it" door, and it now shows both versions of the Controls section, including main's phone-driving text (#60) next to this pull's. Fix first: resolve it so one Controls section keeps main's portrait lever / landscape sticks paragraphs AND this pull's sliders/hold/drive-gate paragraphs, with no markers left (grep for ^<<<<<<<, ^=======, ^>>>>>>>). Also keep the Controls-tab sentence on one wrapped line. The code, tests and design (joint-hold, keepalive pump, owner takes control, offline simulation refused with 503/1013) otherwise read well; I did not find other blockers. Nit for after: the terminal (src/tty.ts) is not mentioned for the owner-always-drives change; say in the README whether it behaves the same there.
Sliders and the 3D model now stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31). This push fixes the README conflict markers from review.
README fix. The earlier merge left conflict markers in Software/README.md.
- The Controls section now has main's paragraphs (phone upright, phone on its side, how touch driving works, wider screens), followed by this pull's (sliders, model and hold; the drive gate's words).
- My older copy of the joystick paragraph is gone, since main's "wider screens" version replaces it.
- The Controls-tab sentence is wrapped like the rest.
- On the nit: the terminal (
src/tty.ts) never drives the arm. It chats, joins and leaves the line, and runs the owner's/endand/mute. So "the owner can always drive" changes nothing there, and the README now says so. - A new test,
src/conflict-markers.test.ts, fails on any conflict marker in the app's sources or the README. It fails on the README as it was committed and passes now.
Why it snapped back. Since #31 the arm server moves a stream at no more than 90°/s. When the stream closes, or goes quiet for 1 s, it holds the arm wherever the arm happens to be. The page closed its stream 250 ms after you let go, so the arm stopped part-way. The page then copied that position back into the slider and the model.
A probe found this. It drags a slider 1200 ticks in 0.3 s through the relay and lets go, run twice on each app commit:
- From #4 to caa4fc0 the arm ends on the target every time.
- From f5d990e on it stops 640–685 ticks short.
The fix is in the page; the server's safety limits are unchanged.
- One hold per joint, shared by the slider and the model (
src/ui/joint-hold.js).
- While you hold a control, pose updates never move it. - After you let go it keeps showing your target until the arm gets there, or until the arm has stopped closing in for 2 s.
- The stream stays open until the arm arrives. Every 250 ms, inside the 1 s dead-man, the page re-sends targets the arm hasn't reached, and held ones too. It never opens a stream to do this. A stop or a refusal clears every pending target, so nothing is sent later.
- One pacer for everything: sliders, model, jogs and touch driving all go through main's
Frames, at most one frame per 33 ms slot. - Two marks per slider: blue for your target, amber for where the arm is. On the model, a faint amber ghost (
src/ui/ghost.js) shows the real arm. - Refusals in words beside the controls (
src/ui/drive-gate.js), with the controls greyed out when you can't drive. - The owner can always drive: their first command takes control.
- The offline simulation is never driven while an arm server is set: commands get 503 and
/followcloses with 1013. - First visit under main's 50 KB budget:
- The hold and drive-gate modules load after the first view.
- The page is sent without its script's whole-line comments (src/page.ts). A test checks the stripped script transpiles to exactly the same code.
Tests. The type check is clean. The full suite passed (370) before this push; this push changes only the README and adds the marker test, which I ran on its own. The issue's four tests are in: a held slider ignores a 30 Hz pose stream, a refusal shows its reason, the owner drives with no queue, and the offline simulation can't be driven. A relay test also runs the flick-and-let-go with the server's real timings: without the keepalive the arm stops more than 300 ticks short, with it the arm ends within 15 ticks.
Not done:
- Sequence numbers on commands are #66's work.
- No Playwright test: the sandbox can't download a browser.
- Not tried on the real arm or in a browser.
To try: on the preview, drag a slider quickly and let go. The thumb should stay put while the amber mark catches up with the blue one. On the model, drag a joint and let go: it stays, and the ghost follows.
🤖 Generated with Claude Code
Joint sliders now move the arm while you drag them, at the shared frame rate. The 3D model follows with them. Each joint shows two marks, one for where you asked it to go and one for where it actually is. While the named arm server is offline, the simulation on screen is only there to look at. The relay refuses commands to it with a 503 that says the arm is reconnecting. Stop commands still get through. The hold and drive-gate modules load after the first view, so a first visit stays under 50 KB.
This update merges the latest main, which adds the machine log. The only conflict was in Software/so101/src/relay.ts, and the fix keeps both sides:
- The offline gate runs first. A refused command is now written to the machine log as "not passed on", the same way the existing reconnecting refusal is.
- After the gate,
main's "sent" and "received" entries wrap each command the relay passes on, whether it goes to the simulation or to the arm.
The follow socket merged without conflicts and was not changed.
To check it: the type check is clean and bun test passes (382 tests). The first full run had one failure that never printed which test it was. Two reruns passed with nothing changed, so it looks like a timing flake, but it is unconfirmed.
To try it on the preview (https://arm--68--forge-trevato-apps.open-platform.sh):
- Drag a joint slider and watch the model and the two marks follow.
- With an arm server named and offline, try to drive. You should get the reconnecting message, and the refusal should appear in the machine panel as "not passed on".
🤖 Generated with Claude Code
Declined: I couldn't find a failure to fix. I changed nothing and pushed nothing. Run log: https://forge.open-platform.sh/trevato/arm/runs/01m5dpcd56jwywrj07r1xj3tan
The sliders and the 3D model now stream live while you drag and stay where you put them. Snap-back began in f5d990e (#31).
Why it snapped back. Since #31 the arm server moves a stream at no more than 90°/s. When the stream closes, or goes quiet for 1 s, it holds the arm wherever the arm happens to be. The page closed its stream 250 ms after you let go, so the arm stopped part-way. The page then copied that position back into the slider and the model. Method: a probe drags a slider 1200 ticks in 0.3 s through the relay and lets go. Run twice on each app commit: from #4 to caa4fc0 the arm ends on the target (3248) every time. From f5d990e on it stops near 2565–2605. The server's own streaming was never broken; a slow drag arrives mid-drag at every commit, over a fast or a 200 ms link.
The fix is in the page, and the server's safety limits stay as they are.
src/ui/joint-hold.js). While you hold a control, pose updates never move it. After you let go it keeps showing your target until the arm gets there, or until the arm has stopped closing in for 2 s (a jam, a limit, the safe zone). That way a slow arm doesn't snap the control back.inputand every modelangle-changeis sent, at most 30 a second, latest value winning (src/ui/frame-pacer.js), and the value label updates as you slide.src/ui/drive-gate.js): "Join the queue to drive", "It's not your turn", "Arm offline - reconnecting", "Stopped - resume first". The controls are always shown, greyed out when you can't drive.src/lobby.ts)./followcloses with 1013, saying "reconnecting".Tests. The type check passes, and I ran the full suite at my first commit (306 pass). The suites my later changes touch pass (118:
src/ui, relay, admin-relay, server, lobby). The issue's four tests are in: a 30 Hz pose stream (including a fall to 2048) doesn't move a held slider, a refused stream shows its reason, the owner drives with no queue, and the offline simulation can't be driven.Other tests added:
relay.test.ts, the bisect probe kept as a regression test: with the server's real timings, a flick-and-let-go ends within 15 ticks of the target, and without the keepalive it stops more than 300 short.relay.test.ts: the arm moves during a drag, not only at the end.server.test.ts: the page's script parses, and every/ui/module it imports is served. It covers a slip in my own first commit on this branch, where an import namedshownclashed with one of the page's own and stopped the page loading. No existing test was changed.Not done:
To try: on the preview, drag a slider quickly and let go. The thumb should stay put while the amber mark catches up with the blue one, then both marks disappear. On the model, drag a joint and let go: it stays, and the ghost follows. Signed in as anyone else, the controls are greyed out with the reason above them.
🤖 Generated with Claude Code
Closes #64