Milestones 3 and 4: models per marker ID, debug overlay, device test protocol #3

Merged
dawid merged 5 commits from content-models into main 2026-11-16 04:58:22 +00:00
Owner

Milestones 3 and 4. This PR is stacked on #1 (its base is viewer-detection): merge #1 first, then this one retargets to main.

Milestone 3: content, models, debug overlay

  • viewer/public/content.json maps marker IDs to models. js/content.js checks it on load: an unknown key, model or field, or an ID out of 0–49, stops the viewer with the reason. An ID without an entry shows the axis gizmo, and the status says "no content".
  • Four placeholder models, generated in code with three.js's shapes, so there are no assets and no licenses beyond the project's own (js/models.js): a cube, a torus knot, a planet with a ring and a moon, a crystal. Each stands on the marker and moves a little.
  • Switching: the model changes with the marker ID, and the new marker's pose starts without the old one's smoothing.
  • Debug overlay (the Debug button or ?debug): ID, distance, FPS, the detection rate over the last second, detection time, and the camera and detection resolutions. With it on, the gizmo is drawn along with the model.
  • Laptops: the viewer asks for the rear camera only as ideal, so a laptop's webcam works too. The README says so.
  • docs/model-ideas.md answers your question about which models to make: utilities (moon phase, globe with day and night, orrery, sun path), aviation (attitude indicator, flight replay), navigation (where did I park, activity in 3D) and playful ones (mascot, pet, snow globe, dice). They're sorted by what each needs: time only, location, phone sensors, or live data. Live data would change the privacy promise, so it's set out as options for you.

Milestone 4: device test protocol

docs/device-tests.md is for you to fill in. It covers setup, range by distance and lighting, angle, session length and the models.

  • Sideloading: copy the .prg to GARMIN/APPS, per Garmin's "Your First App". On macOS, tools/build-watch.sh builds it with your local SDK. It now runs with bash 3.2 and BSD cp, and redirects Java's home only on Linux.
  • The viewer is running on studio at https://8095-dawid.studio.ciepiela.org/, behind your sign-in, until it's deployed in milestone 5. It's container wristmark-viewer, serving this branch's image. HTTPS comes from studio's forwarding, so the phone can open the camera. Add ?size=<measured mm>&debug.

Per the spec, I'm stopping here until you have results.

Verified

  • viewer/test: 8 tests pass, 2 in Node and 6 in Chromium under the production CSP:
    • Chromium's fake camera shows marker 1: the status names the torus knot, data-model is knot, and the overlay lines appear;
    • marker 23 shows "no content";
    • the shipped content.json passes its check, and every model's bounding box stands on the marker's face.
  • Screenshots of the viewer through the fake camera for IDs 0–3: each model sits on its marker. Detection took 8–11 ms per 640×480 frame at 45–59 FPS, in headless Chromium on studio.
  • tools/smoke-test.sh now also checks models.js and content.json, served as JSON. It passes on the image.
  • tools/build-watch.sh builds against a read-only SDK and against a writable one.

Not verified

  • Anything on a real phone, laptop or watch. That's what the protocol is for.
  • How fast detection is on a phone. Headless Chromium on a server says little about it.
  • The MTP tool on macOS for copying to the watch: I named OpenMTP, but didn't check it against Garmin's documentation.

Open questions

  • Which model ideas you want, and whether any live-data model is worth changing the privacy promise for.
  • Whether to keep the viewer running on studio until milestone 5, or stop it after your tests (docker rm -f wristmark-viewer).
Milestones 3 and 4. This PR is stacked on #1 (its base is `viewer-detection`): merge #1 first, then this one retargets to `main`. ## Milestone 3: content, models, debug overlay - **`viewer/public/content.json`** maps marker IDs to models. `js/content.js` checks it on load: an unknown key, model or field, or an ID out of 0–49, stops the viewer with the reason. An ID without an entry shows the axis gizmo, and the status says "no content". - **Four placeholder models**, generated in code with three.js's shapes, so there are no assets and no licenses beyond the project's own (`js/models.js`): a cube, a torus knot, a planet with a ring and a moon, a crystal. Each stands on the marker and moves a little. - **Switching:** the model changes with the marker ID, and the new marker's pose starts without the old one's smoothing. - **Debug overlay** (the **Debug** button or `?debug`): ID, distance, FPS, the detection rate over the last second, detection time, and the camera and detection resolutions. With it on, the gizmo is drawn along with the model. - **Laptops:** the viewer asks for the rear camera only as `ideal`, so a laptop's webcam works too. The README says so. - **`docs/model-ideas.md`** answers your question about which models to make: utilities (moon phase, globe with day and night, orrery, sun path), aviation (attitude indicator, flight replay), navigation (where did I park, activity in 3D) and playful ones (mascot, pet, snow globe, dice). They're sorted by what each needs: time only, location, phone sensors, or live data. Live data would change the privacy promise, so it's set out as options for you. ## Milestone 4: device test protocol **`docs/device-tests.md`** is for you to fill in. It covers setup, range by distance and lighting, angle, session length and the models. - **Sideloading:** copy the `.prg` to `GARMIN/APPS`, per Garmin's "Your First App". On macOS, `tools/build-watch.sh` builds it with your local SDK. It now runs with bash 3.2 and BSD `cp`, and redirects Java's home only on Linux. - **The viewer is running on studio** at https://8095-dawid.studio.ciepiela.org/, behind your sign-in, until it's deployed in milestone 5. It's container `wristmark-viewer`, serving this branch's image. HTTPS comes from studio's forwarding, so the phone can open the camera. Add `?size=<measured mm>&debug`. Per the spec, **I'm stopping here** until you have results. ## Verified - **`viewer/test`:** 8 tests pass, 2 in Node and 6 in Chromium under the production CSP: - Chromium's fake camera shows marker 1: the status names the torus knot, `data-model` is `knot`, and the overlay lines appear; - marker 23 shows "no content"; - the shipped `content.json` passes its check, and every model's bounding box stands on the marker's face. - **Screenshots of the viewer through the fake camera** for IDs 0–3: each model sits on its marker. Detection took 8–11 ms per 640×480 frame at 45–59 FPS, in headless Chromium on studio. - **`tools/smoke-test.sh`** now also checks `models.js` and `content.json`, served as JSON. It passes on the image. - **`tools/build-watch.sh`** builds against a read-only SDK and against a writable one. ## Not verified - Anything on a real phone, laptop or watch. That's what the protocol is for. - How fast detection is on a phone. Headless Chromium on a server says little about it. - The MTP tool on macOS for copying to the watch: I named OpenMTP, but didn't check it against Garmin's documentation. ## Open questions - Which model ideas you want, and whether any live-data model is worth changing the privacy promise for. - Whether to keep the viewer running on studio until milestone 5, or stop it after your tests (`docker rm -f wristmark-viewer`).
content.json maps IDs to four placeholder models generated in code (cube,
torus knot, planet, crystal), checked on load: a wrong entry stops the
viewer with its reason; an ID without content shows the gizmo. The model
switches with the marker ID. The debug overlay (button or ?debug) shows ID,
distance, FPS, detection rate and time, and the resolutions. Milestone 3.
Utilities (moon phase, globe with day and night, orrery, sun path), aviation
(attitude indicator, flight replay), navigation and playful ones (mascot,
snow globe, dice), with what each needs: time only, location, phone sensors,
or live data, which would change the privacy promise.
docs/device-tests.md: setup (sideloading per Garmin's Your First App, the
viewer on studio behind the sign-in), and tables for range, angle, session
length and the models. tools/build-watch.sh works with bash 3.2 and BSD cp,
and redirects Java's home only on Linux.
docs: rewrap a line of the watch page
Some checks failed
CI / checks (pull_request) Has been cancelled
CI / e2e (pull_request) Has been cancelled
CI / image (pull_request) Has been cancelled
CI / watch (pull_request) Has been cancelled
5b2e5681c4
docs(ideas): live flights could come from the owner's Local Flight Map
All checks were successful
CI / checks (pull_request) Successful in 12s
CI / e2e (pull_request) Successful in 1m3s
CI / image (pull_request) Successful in 18s
CI / watch (pull_request) Successful in 16s
ec73c90849
dawid changed target branch from viewer-detection to main 2026-11-16 04:56:33 +00:00
dawid force-pushed content-models from ec73c90849
All checks were successful
CI / checks (pull_request) Successful in 12s
CI / e2e (pull_request) Successful in 1m3s
CI / image (pull_request) Successful in 18s
CI / watch (pull_request) Successful in 16s
to eb27f7b8cc
All checks were successful
CI / checks (pull_request) Successful in 24s
CI / e2e (pull_request) Successful in 2m11s
CI / image (pull_request) Successful in 12s
CI / watch (pull_request) Successful in 16s
2026-11-16 04:57:53 +00:00
Compare
dawid merged commit 57167d9405 into main 2026-11-16 04:58:22 +00:00
dawid deleted branch content-models 2026-11-16 04:58:23 +00:00
Sign in to join this conversation.
No description provided.