Skip to main content

Module ik_motor

Module ik_motor 

Source
Expand description

Analytical Two-Bone, Constrained FABRIK, Coupled Swing-Twist Reach Cones, Scapulo-Humeral Rhythm & Biarticular Tendon Coupling (re-exported from etalon-render).

Structs§

BiarticularLengthConstraint
Passive multi-joint tendon excursion invariant $\sum_k r_{m,k},\theta_k \le L_{m,\max}$ (e.g. rectus femoris, hamstrings, gastrocnemius, extrinsic finger flexors).
BiarticularTerm
One joint-coupling term inside a BiarticularLengthConstraint.
ScapuloHumeralCoupling
Coupled glenohumeral-to-scapulothoracic rhythm (2:1 GH:ST above 30 deg elevation).
SwingTwistConeConstraint
Coupled quaternion swing-twist reach cone with optional polygonal swing boundary, swing-dependent twist narrowing $[\tau_{\min}(\mathbf{s}), \tau_{\max}(\mathbf{s})]$, and synovial translation bounds.
TwoBoneIkResult
Output receipt for solve_two_bone_motor_ik_zero_heap.

Enums§

JointConstraint
Angular constraint applied to a joint during solve_constrained_fabrik_motor_ik_zero_heap.

Constants§

MAX_BIARTICULAR_JOINTS
Maximum joints spanned by a single BiarticularLengthConstraint (HotZeroHeap stack bound).
MAX_IK_CHAIN
Maximum joints in a single constrained FABRIK chain (HotZeroHeap stack bound).
MAX_SWING_POLYGON_VERTICES
Maximum vertices in a polygonal swing cone on $S^2$ (HotZeroHeap stack bound).

Functions§

decompose_swing_twist
Decomposes unit quaternion q ([w, x, y, z]) into (swing, twist) around twist_axis such that quat_mul(swing, twist) == normalize(q) and twist is a pure rotation around twist_axis in the shortest-arc hemisphere (twist[0] >= 0).
project_swing_twist_cone
Projects quaternion q ([w, x, y, z]) onto an elliptical swing-twist reach cone around twist_axis, scaled by laxity_scale.
solve_constrained_fabrik_motor_ik_zero_heap
Solves multi-joint Constrained Forward-And-Backward Reaching Inverse Kinematics (FABRIK) directly on a chain of up to MAX_IK_CHAIN = 16 PGA Motors with zero heap allocations (HotZeroHeap).
solve_two_bone_motor_ik_zero_heap
Analytically solves two-bone inverse kinematics (e.g., hip–knee–ankle or shoulder–elbow–wrist) directly on PGA Motors using the Law of Cosines and a pole-vector bend plane (HotZeroHeap).