Build early_switch_fraction into the sci-fi relay + one-click demo page#1
Merged
Merged
Conversation
…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>
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
early_switch_fractiondid nothing. The relay emitted a sparse trajectory (one bus write per waypoint) and relied on a luckyprofile_velocityto leave the servo mid-motion. The "almost reaching / changing its mind" feel was non-deterministic — "it isn't working well."What changed
sci_fi_waypoint_relay.build_relay_trajectorynow streams a dense overlapping-smoothstep blend through the waypoints.early_switch_fractionsets how much consecutive transitions overlap:1.0settles on every waypoint; lower rounds the corners so the spine never fully settles (the sci-fi flow). Deterministic and independent ofprofile_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.184cm (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_hzis now the dense sample + bus-write rate (default 15 Hz).example.yamldefaults 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.py— 193 passedearly_switch_fractionactually shapes the pathsci_fi_waypoint_preview.pngrender from the dense traceReviewer notes
two_segment_workspace_repeatability_outputs.pywas deliberately left out of this branch.🤖 Generated with Claude Code