code wiki / (root) / nx_robot_kinematics_gate.nx

nx_robot_kinematics_gate.nx

buildroot/runtime/nx_robot_kinematics_gate.nx

6093 B123 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic robot
docsdependenciesstructsconstsfunctions

about

nx_robot_kinematics_gate.nx -- R-ROBO-3 GATE: robot kinematics + the full motion pipeline. VERIFIES: (1) CoreXY FK<->IK round-trips EXACTLY (integer, no drift) on several poses; (2) 2-link arm FORWARD kinematics hits exact KATs at axis angles (0/90/180 deg) and a 45-deg case within Q10 tolerance with x==y symmetry; (3) CAPSTONE -- a Cartesian move is converted to CoreXY motor deltas and fed through nx_robot_step, and the per-motor pulse counts EXACTLY equal the IK motor deltas (pose -> motor-space -> synchronized stepper pulses, the whole "command a robot to move" chain composes); (4) NEGATIVE CONTROL -- a corrupted motor value breaks the round-trip, proving the checks have teeth. 100% sovereign, integer-only. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_robot_kinematics.nx nx_robot_step.nx nx_robot_kinematics_gate.nx

imports: nx_syscalls.nxnx_robot_kinematics.nxnx_robot_step.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap sw sys_write corexy_roundtrip_ok sys_mmap ↻ corexy_ik corexy_fk check sw ↻ arm2_fk nx_cos_turn_q10 sys_mmap ↻ _nx_trig_reduce _nx_cos_q1_table nx_sin_turn_q10 nx_cos_turn_q10 ↻ sn sys_write ↻ sys_mmap ↻ abs_i corexy_ik ↻ robot_step_plan sys_mmap ↻ robot_step_count corexy_fk ↻ sys_exit

structs

none

consts

none

functions

14func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: checkmain calls 1: sys_write
15func sn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
25func check(name: *u8, cond: i64, tot: *i64) -> i64
called by 1: main calls 1: sw
31func abs_i(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
34func corexy_roundtrip_ok(x: i64, y: i64) -> i64
called by 1: main calls 3: sys_mmapcorexy_ikcorexy_fk
45func main() -> i64