code wiki / (root) / nx_ik.nx

nx_ik.nx

buildroot/runtime/nx_ik.nx

4622 B82 linesdepth 3pulls 5 transitivereach 4 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ik.nx -- CCD INVERSE KINEMATICS on nx_skeleton (Elara bar E5: "grab a wrist, the arm follows"; the same solver = robot-arm reach, per the reuse law). Cyclic Coordinate Descent: per sweep, each bone in the chain nudges its yaw/elevation by a fixed integer step in the direction that closes the effector->target angle -- signs come from CROSS PRODUCTS (no arctangent, no float), so the whole solve is integer-deterministic. Yaw sign law: +yaw rotates +x toward -z (CW in the XZ plane seen from +y), so yaw -= sign(crossY)*step. Elevation sign law: es = ty*|eff_h| - effy*|t_h| (elevation-angle comparison without division). license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_skeleton.nx nx_vecmath.nx nx_ik.nx nx_ik_gate.nx nx_wasm_charlab.nx

imports: nx_syscalls.nxnx_skeleton.nxnx_vecmath.nx

imported by: nx_ik_gate.nxnx_wasm_charlab.nx

structs

none

consts

11const K_MAGIC_4096: i64 = 4096

functions

13func ik_isqrt(v: i64) -> i64 { return vm_isqrt(v) }
called by 1: ik_solve calls 1: vm_isqrt
15func ik_effector(sk: i64, tipBone: i64, ex: i64, ey: i64, ez: i64, out: *i64) -> i64
called by 2: ik_solvemain calls 2: sk_bonesk_matvec
32func ik_solve(sk: i64, tipBone: i64, rootStop: i64, ex: i64, ey: i64, ez: i64, tx: i64, ty: i64, tz: i64, iters: i64, step: i64) -> i64