Skip to content

Build early_switch_fraction into the sci-fi relay + one-click demo page#1

Merged
jacklange22 merged 1 commit into
mainfrom
feat/weird-sci-fi-spine-demo
May 29, 2026
Merged

Build early_switch_fraction into the sci-fi relay + one-click demo page#1
jacklange22 merged 1 commit into
mainfrom
feat/weird-sci-fi-spine-demo

Conversation

@jacklange22
Copy link
Copy Markdown
Owner

Summary

Makes the two-segment sci-fi waypoint relay demo actually work and look cool, and strips its GUI to one-click.

Three root problems this fixes:

  1. early_switch_fraction did nothing. The relay emitted a sparse trajectory (one bus write per waypoint) and relied on a lucky profile_velocity to leave the servo mid-motion. The "almost reaching / changing its mind" feel was non-deterministic — "it isn't working well."
  2. Live runs failed precheck. The 0.35 cm preset needs ~221 ticks of travel (top-routing compensation nearly doubles it) but the soft cap defaulted to 200, so the trajectory was rejected before the bus was ever written.
  3. The page exposed ~20 parameters (pattern, amplitude, cycles, ramps, coupling, tick caps, currents, profile) that an operator should never touch for a demo.

What changed

  • sci_fi_waypoint_relay.build_relay_trajectory now streams a dense overlapping-smoothstep blend through the waypoints. early_switch_fraction sets how much consecutive transitions overlap: 1.0 settles on every waypoint; lower rounds the corners so the spine never fully settles (the sci-fi flow). Deterministic and independent of profile_velocity. Total span stays = video_duration_s; every sample clamped to ±amplitude. Verified avg distance-to-waypoint: 0.0 (esf 1.0) → 0.063 (0.72) → 0.184 cm (0.5).
  • two_segment_slow_motion_demo.setup() auto-sizes the soft/hard/step tick caps from the amplitude (tick_budget_for_segment_amplitude_cm) for the relay, so a live run clears precheck first try (0.35 cm → cap 548, actual max 221). Caps are only ever raised. command_rate_hz is now the dense sample + bus-write rate (default 15 Hz).
  • GUI page reduced to: two one-click presets ("20s Sci-Fi Spine (curated)" + "Random Weird Spine"), a dry-run / return-to-neutral toggle, and a live preview. The Run button now states the mode — "Preview (DRY RUN — robot will NOT move)" vs "RUN LIVE — move the robot" — so a dry run is never mistaken for a live one (the Build early_switch_fraction into the sci-fi relay + one-click demo page #1 "nothing is running" confusion).
  • example.yaml defaults to the curated relay so the page loads a known-good demo with nothing to tune.

Why

It's a thesis-presentation demo: it needs to run first try and look cool. The early-switch knob is now the actual visual control, the caps can't block a live run, and the operator just clicks a preset → preview → un-check dry-run → run.

Test plan

  • tests/test_sci_fi_waypoint_relay.py, tests/test_two_segment_slow_motion_demo.py, tests/test_two_segment_motion_patterns.py, tests/test_experiment_framework.py193 passed
  • Updated tests for the dense design; added one asserting early_switch_fraction actually shapes the path
  • End-to-end dry run: 303-point trajectory, all artifacts incl. sci_fi_waypoint_preview.png render from the dense trace
  • Live-precheck math verified: max compensated delta 221 ≤ auto-cap 548 ≤ hard cap 600
  • Hardware: live run on the rig (dual_segment + accepted all-8 startup) to confirm the flow looks right on camera

Reviewer notes

  • Scoped to the slow-motion/sci-fi-relay demo only. An unrelated in-progress change to two_segment_workspace_repeatability_outputs.py was deliberately left out of this branch.

🤖 Generated with Claude Code

…one-click GUI

The two-segment sci-fi waypoint relay never actually used
early_switch_fraction: it emitted a sparse trajectory (one bus write per
waypoint) and relied on a lucky profile_velocity to leave the servo
mid-motion, so the "almost reaching / changing its mind" feel was
non-deterministic and "didn't work well." Live runs also failed precheck
because the 0.35 cm preset needs ~221 ticks of travel but the soft cap
defaulted to 200. And the GUI page exposed ~20 parameters the operator
should never have to touch for a demo.

Changes:
- sci_fi_waypoint_relay.build_relay_trajectory now streams a dense
  overlapping-smoothstep blend through the waypoints. early_switch_fraction
  sets how much consecutive transitions overlap: 1.0 settles on every
  waypoint, lower values round the corners so the spine never fully settles
  (the sci-fi flow). The effect is deterministic and independent of
  profile_velocity. Total span stays = video_duration_s; samples clamped to
  +/-amplitude. Verified avg distance-to-waypoint: 0.0 (esf 1.0) -> 0.063
  (0.72) -> 0.184 cm (0.5).
- two_segment_slow_motion_demo.setup() auto-sizes the soft/hard/step tick
  caps from the amplitude (tick_budget_for_segment_amplitude_cm) for the
  relay, so a live run clears precheck first try (0.35 cm -> cap 548, actual
  max 221). Caps are only ever raised. command_rate_hz is now the dense
  sample + bus write rate (default 15 Hz).
- GUI page stripped to: two one-click presets (curated "Sci-Fi Spine" +
  "Random Weird Spine"), a dry-run/return-to-neutral toggle, and a live
  preview. Removed the pattern/amplitude/cycle/ramp/coupling/tick-cap/
  current/profile parameter soup. The Run button now states the mode
  ("Preview (DRY RUN - robot will NOT move)" vs "RUN LIVE - move the
  robot") so a dry run is never mistaken for a live run.
- example.yaml defaults to the curated relay so the page loads a known-good
  demo with nothing to tune.
- Tests updated for the dense design; added one asserting early_switch_fraction
  actually shapes the path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jacklange22 jacklange22 merged commit dd73fed into main May 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant