Context. The 2nd-order layer: a {DofId → value} snapshot in four flavors, plus how time flows. Easing & Cycle are in the initial set because they buy legible, alive motion.
Objective. Define the spatial fields, Easing, and easing-aware interpolation.
Changes (:ampere-core)
data class DofValue(val kind: DofKind, val data: FloatArray) // size == dof.dimensionality
typealias Pose = Map<DofId, DofValue> // commanded target
typealias Observation = Map<DofId, DofValue> // measured (afferent twin); same shape ⇒ Pose − Observation = agency error
data class DofBound(val min: DofValue, val max: DofValue)
typealias Envelope = Map<DofId, DofBound> // per-DOF safety bounds — the Breaker, as data
typealias SignalField = Map<DofId, Float> // per-DOF display intensity — Phosphor's input
fun interface Easing { fun warp(alpha: Float): Float } // [0,1]->[0,1]; provide Linear, EaseInOut, MinimumJerk
object PoseInterpolator { fun interpolate(a: Pose, b: Pose, alpha: Float, easing: Easing = Easing.Linear): Pose }
fun Envelope.clamp(pose: Pose): Pose
interpolate warps alpha FIRST, then linear for Revolute/Prismatic/Activation, SLERP for Spherical. Activation interpolates linearly but is flagged actuation-space (config↔actuation inverse = a Load concern, deferred).
Validation
Interpolate a 2-keyframe pair per DofKind at α=0.5; assert MinimumJerk ≠ Linear at the same α; assert Spherical uses SLERP (not componentwise lerp); assert Pose − Observation computes (same shape); assert Envelope.clamp bounds an out-of-range pose; assert the arm morphology interpolates on the identical path.
Out of scope
Arc composition; emission; the actuation-space inverse mapping.
Scope ~3–4 pts · Model: Sonnet, medium thinking.
Context. The 2nd-order layer: a
{DofId → value}snapshot in four flavors, plus how time flows. Easing & Cycle are in the initial set because they buy legible, alive motion.Objective. Define the spatial fields,
Easing, and easing-aware interpolation.Changes (
:ampere-core)interpolatewarps alpha FIRST, then linear for Revolute/Prismatic/Activation, SLERP for Spherical.Activationinterpolates linearly but is flagged actuation-space (config↔actuation inverse = aLoadconcern, deferred).Validation
Interpolate a 2-keyframe pair per DofKind at α=0.5; assert MinimumJerk ≠ Linear at the same α; assert Spherical uses SLERP (not componentwise lerp); assert
Pose − Observationcomputes (same shape); assertEnvelope.clampbounds an out-of-range pose; assert the arm morphology interpolates on the identical path.Out of scope
Arc composition; emission; the actuation-space inverse mapping.
Scope ~3–4 pts · Model: Sonnet, medium thinking.