@@ -18,17 +18,11 @@ import {
1818} from './__fixtures__/previewMoveHarness.svelte'
1919
2020const dump = parsePlan ( planJson )
21- /**
22- * The rig `plan-gantry.json` (`interpolateTrajectory.spec.ts`) was lifted from: a 40 mm prismatic
23- * slide, captured rather than hand-written so the joint is genuinely `type: "prismatic"` in the
24- * model JSON and not just labelled that way by a test double.
25- */
2621const gantryDump = parsePlan ( gantryPlanJson )
2722
2823/**
29- * A part's `kinematics` carries the same `ModelConfigJSON` a dump nests under
30- * `frames[partName].frame.model`, so a realistic frame system can be lifted out of a fixture instead
31- * of hand-written — geometry, joint chain and all.
24+ * A part's `kinematics` is the same `ModelConfigJSON` a dump nests under `frames[part].frame.model`,
25+ * so a fixture yields a realistic frame system: geometry, joint chain and all.
3226 */
3327const kinematicsFromDump = ( source : ParsedPlan , partName : string ) : Struct => {
3428 const entry = source . frames [ partName ]
@@ -65,23 +59,15 @@ const SHAPELESS = part(
6559 } as never )
6660)
6761
68- /**
69- * One prismatic joint, real rather than hand-labelled: `gantry-plan.json`'s model has a `carriage`
70- * link riding a `type: "prismatic"` joint, so a descriptor built from it is what `jointMotionsOf`
71- * would actually see off a machine, not a stand-in built to say `'translational'`.
72- */
62+ /** A captured `type: "prismatic"` joint, not a double hand-labelled `'translational'`. */
7363const GANTRY = part ( 'gantry-1' , kinematicsFromDump ( gantryDump , 'gantry-1' ) )
7464
7565/** Two distinct configurations, so it never reads as "already at the goal". */
7666const PLAN_REPLY : JsonValue = {
7767 plan : [ { 'left-arm' : [ 0 , 0 , 0 , 0 , 0 , 0 ] } , { 'left-arm' : [ 1 , 0 , 0 , 0 , 0 , 0 ] } ] ,
7868}
7969
80- /**
81- * The same 40 mm slide `gantry-plan.json` captures: `gantry-1` moving from 50 to
82- * 90.00000000000001, everything else held. Read as radians instead of millimetres, that stroke is
83- * over 2291°, which is the gap `interpolatedFrames`'s `motions` argument exists to close.
84- */
70+ /** The 40 mm slide `gantry-plan.json` captures. Read as radians rather than millimetres it is 2291°. */
8571const GANTRY_SLIDE : JsonValue = {
8672 plan : [ { 'gantry-1' : [ 50 ] } , { 'gantry-1' : [ 90.00000000000001 ] } ] ,
8773}
@@ -303,13 +289,8 @@ describe('where the ghosts stand before anything is scrubbed', () => {
303289} )
304290
305291/**
306- * The hook keeps two arrays and they answer different questions. `trajectory` is what the planner
307- * said and the only thing `execute` may be handed; `playbackFrames` is that same motion subdivided
308- * for the scrubber, which the robot must never be asked to run.
309- *
310- * Nothing had ever told them apart: returning the playback frames from `get trajectory()` — handing
311- * the robot the interpolated ones — passed the whole suite. Subdividing is what makes the two
312- * observably different, so this is the first PR in which the distinction can be pinned at all.
292+ * `trajectory` is the only thing `execute` may be handed; `playbackFrames` is that same motion
293+ * subdivided for the scrubber, which the robot must never be asked to run.
313294 */
314295describe ( 'what the scrubber walks' , ( ) => {
315296 it ( 'plays one frame per configuration the planner returned' , async ( ) => {
@@ -388,10 +369,6 @@ describe('the request the panel sends', () => {
388369 } )
389370} )
390371
391- /**
392- * `waypointIndices` is what the scrubber draws its tick marks from, and it is the only thing telling
393- * a user which of 180 interpolated frames the planner actually chose.
394- */
395372describe ( 'marking which played frames are planned waypoints' , ( ) => {
396373 it ( 'marks every frame when each one is a waypoint' , async ( ) => {
397374 const h = setup ( )
@@ -417,11 +394,6 @@ describe('marking which played frames are planned waypoints', () => {
417394 } )
418395} )
419396
420- /**
421- * The two detail settings are different framings of one motion, so a frame index does not carry
422- * across. Leaving `currentStep` where it was pointed the scrubber past the end of the shorter
423- * framing and left the ghosts showing a pose from the other one.
424- */
425397describe ( 'switching what a frame represents' , ( ) => {
426398 it ( 'restarts playback rather than keeping an index that no longer means anything' , async ( ) => {
427399 const h = setup ( )
@@ -440,12 +412,8 @@ describe('switching what a frame represents', () => {
440412 } )
441413
442414 /**
443- * `interpolatedFrames` costs a joint's travel in degrees unless told otherwise, so a component the
444- * hook does not label as prismatic has its millimetres read as radians — a 40 mm slide costs the
445- * same as 40 radians of arm travel, over 200 turns. `jointMotionsOf(descriptors)` is what supplies
446- * that label; `interpolateTrajectory.spec.ts` measures the unlabelled cost of this exact slide at
447- * 1,529 frames against 10 labelled, so anything under 50 here is only reachable with the label
448- * wired through.
415+ * Where the 50 comes from: without `jointMotionsOf`'s labels, `interpolateTrajectory.spec.ts`
416+ * measures this exact slide at 1,529 frames against 10 labelled.
449417 */
450418 it ( 'keeps a gantry slide within its millimetre budget instead of costing it in radians' , async ( ) => {
451419 const h = setup ( [ GANTRY ] )
0 commit comments