Offer interpolated preview playback, filling in frames between planned waypoints - #1014
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: cc3c865 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
August 27, 2026 15:50
f31201a to
5d7730e
Compare
Contributor
|
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
August 27, 2026 17:47
5d7730e to
e9f198b
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
August 28, 2026 15:40
e9f198b to
8a5eef9
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
August 31, 2026 13:11
8a5eef9 to
ac1e6ec
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
August 31, 2026 13:42
ac1e6ec to
25ed01a
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
2 times, most recently
from
August 31, 2026 18:49
ca8fcfd to
13c4f1e
Compare
Devin T. Currie (DTCurrie)
force-pushed
the
preview/5-interpolated-playback
branch
from
September 2, 2026 17:49
13c4f1e to
cc3c865
Compare
Micheal Parks (micheal-parks)
approved these changes
Sep 2, 2026
Devin T. Currie (DTCurrie)
deleted the
preview/5-interpolated-playback
branch
September 3, 2026 14:13
Merged
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.
Adds a Waypoints / Interpolated toggle to the preview, the last of five stacked PRs and based on
preview/4-scrub-execute. Interpolated fills in frames between planned waypoints along the straight joint path RDK collision-checks, so a two-waypoint plan sweeps instead of snapping, and marks which played frames are real waypoints on the scrubber.Motion
interpolateTrajectory.tsis new.waypointFramesreturns the plan unchanged,interpolatedFramessubdivides each segment against a per-frame budget ofDEFAULT_DEGREES_PER_FRAMEandDEFAULT_MILLIMETRES_PER_FRAME, andMAX_INTERPOLATED_FRAMEScaps the result, reporting how much the cap coarsened it.lerpTrajectoryStepmirrors RDK'sinterpolateInputsfromreferenceframe/input.go.largestJointDeltareports the largest single-joint change between two steps.Hooks
usePreviewMoveseparates what the scrubber walks from whatexecutereceives.playbackFramesis the played sequence,trajectorystays the planned one, and onlytrajectoryis ever handed toexecute.detailselects the framing,waypointIndicessays which played frames are waypoints, and settingdetailrebuilds the frames and restarts playback.Move panel
MovePreview.sveltegains the toggle and a frame count that reads correctly for either framing. The scrubber takeswaypointIndicesas markers.Why?
Why keep
playbackFramesseparate fromtrajectoryrather than replacing it?Interpolated frames are a display concern. The plan is what the service agreed to run, and handing interpolated steps to
executewould ask the machine to run a trajectory the planner never produced.Why does changing
detailrestart playback instead of mapping the current frame?A frame index does not carry across the two framings. Frame 7 of an interpolated sweep and frame 7 of a waypoint list are unrelated positions, so mapping one to the other would jump the ghost somewhere the user did not ask for.
Why is
largestJointDeltanot named for a unit?It maxes
Math.absacross every joint indiscriminately, so a revolute joint contributes radians and a prismatic one contributes millimetres. It was previously calledjointTravelRadians, which asserted a unit the function does not have.Why an
on:inputdirective, whensvelte.mdbans everyon:-prefixed directive?ToggleButtonsis a legacycreateEventDispatchercomponent in prime-core with no callback prop, so the alternative is rebuilding the segmented control out of two buttons.frontend-aesthetics.mdsays to extend PRIME rather than re-derive its primitives, and it is the repo-owned rule where the kit rule disagrees. The directive goes when prime-core replaces the dispatcher, which is noted at the call site.Why is one fixture minified and in
.prettierignore?plan-linear-constrained.jsonis a 225-step capture that runs about 2,000 lines pretty-printed and is never read by eye. Its three sibling fixtures are small and stay formatted.Testing
Ran
pnpm exec vitest --run,pnpm exec svelte-check --tsconfig ./tsconfig.json,pnpm exec eslint ., andpnpm exec prettier --check .. All four are green: 96 test files, 1215 tests, zero failures, and no svelte-check errors or warnings.Added
src/lib/motion/__tests__/interpolateTrajectory.spec.tsand four recorded plan fixtures: free space, a gantry, a linear-constrained capture, and a synthetic obstacle route. Extended the hook and panel specs to cover which sequence the scrubber walks, the frame-count wording for both framings, and the toggle'saria-pressedstate.