feat(units): SI-array seam (SpatialSi6 + to_si_3/6), Stewart IK onto it #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "patman/uom-si-seam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this does
Adds the SI-array seam between the typed layer (Ring 1/2) and the raw-
f64matrix kernel (Ring 3), and refactors Stewart IK onto it.to_si_3()/from_si_3()on all seven*Vec3types (Ring-2→Ring-3 bridge).SpatialSi6 { linear: [f64;3], angular: [f64;3] }— a named-field struct, not a bare[f64;6], so a future mechanism using a different (e.g. Featherstone[ω;v]) block ordering cannot silently mis-pack a Jacobian and still type-check.to_si_6()/from_si_6()onTwist,SpatialAcceleration,SpatialJerk.stewart::platform_twist_to_leg_ratesrefactored to consumetwist.to_si_6()via.linear/.angularby name (behavior-preserving; the[Velocity;6]homogeneous re-wrap is unchanged).Why named blocks (critique C6)
The seam is "the new AngleKind": a bare
[f64;6]records nothing about which half is linear vs angular, so a convention mismatch would type-check as[Velocity;6]while being wrong. The named-field struct + a seam-ordering pin test prevent that.Verification
buck2 test //common:common-tests→ 95 passed (6 new:to_si_3/to_si_6round-trips + the ordering pin). The existing Stewart FD proptests pass unchanged (the behavior-preserving guarantee). Two independent adversarial reviews found no bugs (high confidence). Noquaternion.rs/transform.rsdrift.Stack position
PR 1 of the typed-vector/CAM series → base #40 (the Vec3 macro). Night-session build; see
docs/superpowers/cam-typed-layer-design.md.Note:
to_si_6/from_si_6could also beconst(a non-blocking consistency polish flagged in review); deferred.Promote the open-coded Ring-2->Ring-3 seam (the six .as_mps()/.as_rad_per_s() calls in platform_twist_to_leg_rates) to named, tested methods. The seam target is SpatialSi6 { linear: [f64;3], angular: [f64;3] } — a named-field struct, NOT a bare [f64;6], so a future mechanism using a different (e.g. Featherstone [w;v]) ordering cannot silently type-check as [Velocity;6]. Co-authored-by: patman-assist <patrick-ai@kgroo.co>