From cd7e4de650b42017b851ea611502377aed67cf76 Mon Sep 17 00:00:00 2001 From: Ash-Pera Date: Tue, 24 Nov 2026 17:52:07 -0700 Subject: [PATCH] tests: round-trip kinematics modules at random points of their range Most kinematics tests check a module at a few hand-picked points. kins-unwrap's walkcheck now also checks 21 modules at 2000 points per case and kinematics type, drawn from a fixed random seed in a box in each module's working range. For serial machines it draws joints, takes their pose from the forward, and calls the inverse with that pose, the forward's flags and joints 1e-3 off, as motion does on the next servo cycle: the walk's check, seeded a cycle off the joints instead of with the step before. The inverse must return the same joints, not another branch or a joint a whole turn away. For the parallel machines and the gantry it draws a pose instead, takes its joints from the inverse, and requires the forward, seeded 1e-3 off the pose, to return it. walkcheck now takes a joint count past six and a tool offset, runs every kinematics type of the module, and fails a NaN joint, which the old > compare let through. Each case is now a hal file in its module's directory, the walks included, since 18 of the 30 box cases need setp lines or module arguments. All 40 pass with rseed=1 to 25; the scarakins and three21kins cases fail with #4867 reverted, and the pumakins cases with its unwrap taken out. genserkins and rosekins are left out until their fixes land. --- tests/kins-unwrap/5axiskins/checkresult | 1 + tests/kins-unwrap/5axiskins/defaults.hal | 3 + tests/kins-unwrap/5axiskins/skip | 1 + tests/kins-unwrap/5axiskins/test.sh | 1 + tests/kins-unwrap/5axiskins/tool-motion.hal | 3 + tests/kins-unwrap/corexykins/checkresult | 1 + tests/kins-unwrap/corexykins/defaults.hal | 3 + tests/kins-unwrap/corexykins/skip | 1 + tests/kins-unwrap/corexykins/test.sh | 1 + tests/kins-unwrap/genhexkins/checkresult | 1 + tests/kins-unwrap/genhexkins/no-lead.hal | 4 + tests/kins-unwrap/genhexkins/screw-lead.hal | 6 + tests/kins-unwrap/genhexkins/skip | 1 + tests/kins-unwrap/genhexkins/test.sh | 1 + tests/kins-unwrap/lineardeltakins/checkresult | 1 + .../kins-unwrap/lineardeltakins/defaults.hal | 4 + tests/kins-unwrap/lineardeltakins/skip | 1 + tests/kins-unwrap/lineardeltakins/test.sh | 1 + tests/kins-unwrap/matrixkins/checkresult | 1 + tests/kins-unwrap/matrixkins/cross-terms.hal | 10 + tests/kins-unwrap/matrixkins/skip | 1 + tests/kins-unwrap/matrixkins/test.sh | 1 + tests/kins-unwrap/maxkins/checkresult | 1 + tests/kins-unwrap/maxkins/pivot.hal | 5 + tests/kins-unwrap/maxkins/skip | 1 + tests/kins-unwrap/maxkins/test.sh | 1 + tests/kins-unwrap/millturn/checkresult | 1 + tests/kins-unwrap/millturn/defaults.hal | 3 + tests/kins-unwrap/millturn/skip | 1 + tests/kins-unwrap/millturn/test.sh | 1 + tests/kins-unwrap/pentakins/checkresult | 1 + tests/kins-unwrap/pentakins/defaults.hal | 5 + tests/kins-unwrap/pentakins/skip | 1 + tests/kins-unwrap/pentakins/test.sh | 1 + tests/kins-unwrap/pumakins/walk-elbow.hal | 3 + tests/kins-unwrap/pumakins/walk-shoulder.hal | 3 + tests/kins-unwrap/pumakins/walk-waist.hal | 3 + tests/kins-unwrap/pumakins/walk-wrist.hal | 6 + tests/kins-unwrap/pumakins/walks | 11 - tests/kins-unwrap/pumakins/wrist-down.hal | 3 + tests/kins-unwrap/pumakins/wrist-up.hal | 6 + tests/kins-unwrap/rotarydeltakins/checkresult | 1 + .../kins-unwrap/rotarydeltakins/defaults.hal | 3 + tests/kins-unwrap/rotarydeltakins/skip | 1 + tests/kins-unwrap/rotarydeltakins/test.sh | 1 + tests/kins-unwrap/rotatekins/checkresult | 1 + tests/kins-unwrap/rotatekins/defaults.hal | 3 + tests/kins-unwrap/rotatekins/skip | 1 + tests/kins-unwrap/rotatekins/test.sh | 1 + tests/kins-unwrap/scarakins/sim-limits.hal | 4 + .../kins-unwrap/scarakins/walk-elbow-neg.hal | 3 + .../kins-unwrap/scarakins/walk-elbow-pos.hal | 3 + tests/kins-unwrap/scarakins/walks | 3 - tests/kins-unwrap/scorbot-kins/checkresult | 1 + tests/kins-unwrap/scorbot-kins/one-arm.hal | 4 + tests/kins-unwrap/scorbot-kins/skip | 1 + tests/kins-unwrap/scorbot-kins/test.sh | 1 + tests/kins-unwrap/shared-checkresult | 13 +- tests/kins-unwrap/shared-test.sh | 22 +- tests/kins-unwrap/three21kins/walk-elbow.hal | 3 + .../kins-unwrap/three21kins/walk-shoulder.hal | 3 + tests/kins-unwrap/three21kins/walk-waist.hal | 3 + tests/kins-unwrap/three21kins/walk-wrist.hal | 3 + tests/kins-unwrap/three21kins/walks | 5 - tests/kins-unwrap/three21kins/wrist-down.hal | 3 + tests/kins-unwrap/three21kins/wrist-up.hal | 3 + tests/kins-unwrap/tripodkins/checkresult | 1 + tests/kins-unwrap/tripodkins/scaled.hal | 7 + tests/kins-unwrap/tripodkins/skip | 1 + tests/kins-unwrap/tripodkins/test.sh | 1 + tests/kins-unwrap/trivkins/checkresult | 1 + tests/kins-unwrap/trivkins/gantry.hal | 4 + tests/kins-unwrap/trivkins/nine-axes.hal | 3 + tests/kins-unwrap/trivkins/skip | 1 + tests/kins-unwrap/trivkins/test.sh | 1 + tests/kins-unwrap/walkcheck.c | 327 ++++++++++++++---- tests/kins-unwrap/xyzab_tdr_kins/checkresult | 1 + tests/kins-unwrap/xyzab_tdr_kins/offsets.hal | 8 + tests/kins-unwrap/xyzab_tdr_kins/skip | 1 + tests/kins-unwrap/xyzab_tdr_kins/test.sh | 1 + tests/kins-unwrap/xyzac-trt-kins/checkresult | 1 + .../xyzac-trt-kins/conventional.hal | 10 + tests/kins-unwrap/xyzac-trt-kins/skip | 1 + tests/kins-unwrap/xyzac-trt-kins/test.sh | 1 + tests/kins-unwrap/xyzac-trt-kins/tool-pin.hal | 10 + tests/kins-unwrap/xyzacb_trsrn/checkresult | 1 + tests/kins-unwrap/xyzacb_trsrn/skip | 1 + tests/kins-unwrap/xyzacb_trsrn/test.sh | 1 + .../kins-unwrap/xyzacb_trsrn/tool-motion.hal | 13 + tests/kins-unwrap/xyzacb_trsrn/tool-pin.hal | 15 + tests/kins-unwrap/xyzbc-trt-kins/checkresult | 1 + .../xyzbc-trt-kins/conventional.hal | 10 + tests/kins-unwrap/xyzbc-trt-kins/skip | 1 + tests/kins-unwrap/xyzbc-trt-kins/test.sh | 1 + tests/kins-unwrap/xyzbc-trt-kins/tool-pin.hal | 10 + tests/kins-unwrap/xyzbca_trsrn/checkresult | 1 + tests/kins-unwrap/xyzbca_trsrn/skip | 1 + tests/kins-unwrap/xyzbca_trsrn/test.sh | 1 + .../kins-unwrap/xyzbca_trsrn/tool-motion.hal | 13 + tests/kins-unwrap/xyzbca_trsrn/tool-pin.hal | 15 + 100 files changed, 565 insertions(+), 96 deletions(-) create mode 120000 tests/kins-unwrap/5axiskins/checkresult create mode 100644 tests/kins-unwrap/5axiskins/defaults.hal create mode 120000 tests/kins-unwrap/5axiskins/skip create mode 120000 tests/kins-unwrap/5axiskins/test.sh create mode 100644 tests/kins-unwrap/5axiskins/tool-motion.hal create mode 120000 tests/kins-unwrap/corexykins/checkresult create mode 100644 tests/kins-unwrap/corexykins/defaults.hal create mode 120000 tests/kins-unwrap/corexykins/skip create mode 120000 tests/kins-unwrap/corexykins/test.sh create mode 120000 tests/kins-unwrap/genhexkins/checkresult create mode 100644 tests/kins-unwrap/genhexkins/no-lead.hal create mode 100644 tests/kins-unwrap/genhexkins/screw-lead.hal create mode 120000 tests/kins-unwrap/genhexkins/skip create mode 120000 tests/kins-unwrap/genhexkins/test.sh create mode 120000 tests/kins-unwrap/lineardeltakins/checkresult create mode 100644 tests/kins-unwrap/lineardeltakins/defaults.hal create mode 120000 tests/kins-unwrap/lineardeltakins/skip create mode 120000 tests/kins-unwrap/lineardeltakins/test.sh create mode 120000 tests/kins-unwrap/matrixkins/checkresult create mode 100644 tests/kins-unwrap/matrixkins/cross-terms.hal create mode 120000 tests/kins-unwrap/matrixkins/skip create mode 120000 tests/kins-unwrap/matrixkins/test.sh create mode 120000 tests/kins-unwrap/maxkins/checkresult create mode 100644 tests/kins-unwrap/maxkins/pivot.hal create mode 120000 tests/kins-unwrap/maxkins/skip create mode 120000 tests/kins-unwrap/maxkins/test.sh create mode 120000 tests/kins-unwrap/millturn/checkresult create mode 100644 tests/kins-unwrap/millturn/defaults.hal create mode 120000 tests/kins-unwrap/millturn/skip create mode 120000 tests/kins-unwrap/millturn/test.sh create mode 120000 tests/kins-unwrap/pentakins/checkresult create mode 100644 tests/kins-unwrap/pentakins/defaults.hal create mode 120000 tests/kins-unwrap/pentakins/skip create mode 120000 tests/kins-unwrap/pentakins/test.sh create mode 100644 tests/kins-unwrap/pumakins/walk-elbow.hal create mode 100644 tests/kins-unwrap/pumakins/walk-shoulder.hal create mode 100644 tests/kins-unwrap/pumakins/walk-waist.hal create mode 100644 tests/kins-unwrap/pumakins/walk-wrist.hal delete mode 100644 tests/kins-unwrap/pumakins/walks create mode 100644 tests/kins-unwrap/pumakins/wrist-down.hal create mode 100644 tests/kins-unwrap/pumakins/wrist-up.hal create mode 120000 tests/kins-unwrap/rotarydeltakins/checkresult create mode 100644 tests/kins-unwrap/rotarydeltakins/defaults.hal create mode 120000 tests/kins-unwrap/rotarydeltakins/skip create mode 120000 tests/kins-unwrap/rotarydeltakins/test.sh create mode 120000 tests/kins-unwrap/rotatekins/checkresult create mode 100644 tests/kins-unwrap/rotatekins/defaults.hal create mode 120000 tests/kins-unwrap/rotatekins/skip create mode 120000 tests/kins-unwrap/rotatekins/test.sh create mode 100644 tests/kins-unwrap/scarakins/sim-limits.hal create mode 100644 tests/kins-unwrap/scarakins/walk-elbow-neg.hal create mode 100644 tests/kins-unwrap/scarakins/walk-elbow-pos.hal delete mode 100644 tests/kins-unwrap/scarakins/walks create mode 120000 tests/kins-unwrap/scorbot-kins/checkresult create mode 100644 tests/kins-unwrap/scorbot-kins/one-arm.hal create mode 120000 tests/kins-unwrap/scorbot-kins/skip create mode 120000 tests/kins-unwrap/scorbot-kins/test.sh create mode 100644 tests/kins-unwrap/three21kins/walk-elbow.hal create mode 100644 tests/kins-unwrap/three21kins/walk-shoulder.hal create mode 100644 tests/kins-unwrap/three21kins/walk-waist.hal create mode 100644 tests/kins-unwrap/three21kins/walk-wrist.hal delete mode 100644 tests/kins-unwrap/three21kins/walks create mode 100644 tests/kins-unwrap/three21kins/wrist-down.hal create mode 100644 tests/kins-unwrap/three21kins/wrist-up.hal create mode 120000 tests/kins-unwrap/tripodkins/checkresult create mode 100644 tests/kins-unwrap/tripodkins/scaled.hal create mode 120000 tests/kins-unwrap/tripodkins/skip create mode 120000 tests/kins-unwrap/tripodkins/test.sh create mode 120000 tests/kins-unwrap/trivkins/checkresult create mode 100644 tests/kins-unwrap/trivkins/gantry.hal create mode 100644 tests/kins-unwrap/trivkins/nine-axes.hal create mode 120000 tests/kins-unwrap/trivkins/skip create mode 120000 tests/kins-unwrap/trivkins/test.sh create mode 120000 tests/kins-unwrap/xyzab_tdr_kins/checkresult create mode 100644 tests/kins-unwrap/xyzab_tdr_kins/offsets.hal create mode 120000 tests/kins-unwrap/xyzab_tdr_kins/skip create mode 120000 tests/kins-unwrap/xyzab_tdr_kins/test.sh create mode 120000 tests/kins-unwrap/xyzac-trt-kins/checkresult create mode 100644 tests/kins-unwrap/xyzac-trt-kins/conventional.hal create mode 120000 tests/kins-unwrap/xyzac-trt-kins/skip create mode 120000 tests/kins-unwrap/xyzac-trt-kins/test.sh create mode 100644 tests/kins-unwrap/xyzac-trt-kins/tool-pin.hal create mode 120000 tests/kins-unwrap/xyzacb_trsrn/checkresult create mode 120000 tests/kins-unwrap/xyzacb_trsrn/skip create mode 120000 tests/kins-unwrap/xyzacb_trsrn/test.sh create mode 100644 tests/kins-unwrap/xyzacb_trsrn/tool-motion.hal create mode 100644 tests/kins-unwrap/xyzacb_trsrn/tool-pin.hal create mode 120000 tests/kins-unwrap/xyzbc-trt-kins/checkresult create mode 100644 tests/kins-unwrap/xyzbc-trt-kins/conventional.hal create mode 120000 tests/kins-unwrap/xyzbc-trt-kins/skip create mode 120000 tests/kins-unwrap/xyzbc-trt-kins/test.sh create mode 100644 tests/kins-unwrap/xyzbc-trt-kins/tool-pin.hal create mode 120000 tests/kins-unwrap/xyzbca_trsrn/checkresult create mode 120000 tests/kins-unwrap/xyzbca_trsrn/skip create mode 120000 tests/kins-unwrap/xyzbca_trsrn/test.sh create mode 100644 tests/kins-unwrap/xyzbca_trsrn/tool-motion.hal create mode 100644 tests/kins-unwrap/xyzbca_trsrn/tool-pin.hal diff --git a/tests/kins-unwrap/5axiskins/checkresult b/tests/kins-unwrap/5axiskins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/5axiskins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/5axiskins/defaults.hal b/tests/kins-unwrap/5axiskins/defaults.hal new file mode 100644 index 00000000000..fd02517d748 --- /dev/null +++ b/tests/kins-unwrap/5axiskins/defaults.hal @@ -0,0 +1,3 @@ +# the module's defaults; B to 120, C past a whole turn +loadrt 5axiskins coordinates=XYZBCW +loadrt walkcheck joints=6 lo=-100,-100,-100,-120,-400,-10 hi=100,100,100,120,400,10 diff --git a/tests/kins-unwrap/5axiskins/skip b/tests/kins-unwrap/5axiskins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/5axiskins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/5axiskins/test.sh b/tests/kins-unwrap/5axiskins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/5axiskins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/5axiskins/tool-motion.hal b/tests/kins-unwrap/5axiskins/tool-motion.hal new file mode 100644 index 00000000000..91348a4a010 --- /dev/null +++ b/tests/kins-unwrap/5axiskins/tool-motion.hal @@ -0,0 +1,3 @@ +# as defaults.hal, with a tool offset handed over as motion does +loadrt 5axiskins coordinates=XYZBCW +loadrt walkcheck joints=6 tool=4,3,12 lo=-100,-100,-100,-120,-400,-10 hi=100,100,100,120,400,10 diff --git a/tests/kins-unwrap/corexykins/checkresult b/tests/kins-unwrap/corexykins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/corexykins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/corexykins/defaults.hal b/tests/kins-unwrap/corexykins/defaults.hal new file mode 100644 index 00000000000..b10fae24746 --- /dev/null +++ b/tests/kins-unwrap/corexykins/defaults.hal @@ -0,0 +1,3 @@ +# a linear map +loadrt corexykins +loadrt walkcheck joints=9 lo=-100,-100,-100,-400,-400,-400,-10,-10,-10 hi=100,100,100,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/corexykins/skip b/tests/kins-unwrap/corexykins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/corexykins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/corexykins/test.sh b/tests/kins-unwrap/corexykins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/corexykins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/genhexkins/checkresult b/tests/kins-unwrap/genhexkins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/genhexkins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/genhexkins/no-lead.hal b/tests/kins-unwrap/genhexkins/no-lead.hal new file mode 100644 index 00000000000..16f33b9a712 --- /dev/null +++ b/tests/kins-unwrap/genhexkins/no-lead.hal @@ -0,0 +1,4 @@ +# a parallel machine, from the pose side +loadrt genhexkins +setp genhexkins.screw-lead 0 +loadrt walkcheck joints=6 frompose=1 lo=-5,-5,10,-10,-10,-15 hi=5,5,30,10,10,15 diff --git a/tests/kins-unwrap/genhexkins/screw-lead.hal b/tests/kins-unwrap/genhexkins/screw-lead.hal new file mode 100644 index 00000000000..d74717c48a1 --- /dev/null +++ b/tests/kins-unwrap/genhexkins/screw-lead.hal @@ -0,0 +1,6 @@ +# as no-lead.hal with a screw lead; near y = 2 the forward, seeded a +# cycle off, can land on another pose with the same strut lengths, so +# y is held below 1 +loadrt genhexkins +setp genhexkins.screw-lead 5 +loadrt walkcheck joints=6 frompose=1 lo=-5,-5,10,-10,-10,-15 hi=5,1,30,10,10,15 diff --git a/tests/kins-unwrap/genhexkins/skip b/tests/kins-unwrap/genhexkins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/genhexkins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/genhexkins/test.sh b/tests/kins-unwrap/genhexkins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/genhexkins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/lineardeltakins/checkresult b/tests/kins-unwrap/lineardeltakins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/lineardeltakins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/lineardeltakins/defaults.hal b/tests/kins-unwrap/lineardeltakins/defaults.hal new file mode 100644 index 00000000000..69fa213e264 --- /dev/null +++ b/tests/kins-unwrap/lineardeltakins/defaults.hal @@ -0,0 +1,4 @@ +# a parallel machine, from the pose side; x and y held to 70, so the +# box's corners stay within the arms' reach; a to w pass straight through +loadrt lineardeltakins +loadrt walkcheck joints=9 frompose=1 lo=-70,-70,-300,-400,-400,-400,-10,-10,-10 hi=70,70,-100,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/lineardeltakins/skip b/tests/kins-unwrap/lineardeltakins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/lineardeltakins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/lineardeltakins/test.sh b/tests/kins-unwrap/lineardeltakins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/lineardeltakins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/matrixkins/checkresult b/tests/kins-unwrap/matrixkins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/matrixkins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/matrixkins/cross-terms.hal b/tests/kins-unwrap/matrixkins/cross-terms.hal new file mode 100644 index 00000000000..2aab33b0c26 --- /dev/null +++ b/tests/kins-unwrap/matrixkins/cross-terms.hal @@ -0,0 +1,10 @@ +# a linear map with every cross term set +loadrt matrixkins +setp matrixkins.C_xy 0.02 +setp matrixkins.C_xz -0.01 +setp matrixkins.C_yx 0.03 +setp matrixkins.C_yz 0.015 +setp matrixkins.C_zx -0.02 +setp matrixkins.C_zy 0.01 +setp matrixkins.C_zz 1.001 +loadrt walkcheck joints=9 lo=-100,-100,-100,-400,-400,-400,-10,-10,-10 hi=100,100,100,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/matrixkins/skip b/tests/kins-unwrap/matrixkins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/matrixkins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/matrixkins/test.sh b/tests/kins-unwrap/matrixkins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/matrixkins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/maxkins/checkresult b/tests/kins-unwrap/maxkins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/maxkins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/maxkins/pivot.hal b/tests/kins-unwrap/maxkins/pivot.hal new file mode 100644 index 00000000000..4faf6e7c3a7 --- /dev/null +++ b/tests/kins-unwrap/maxkins/pivot.hal @@ -0,0 +1,5 @@ +# a pivot length of 100, the size of the box; B to 120, C past a whole turn, +# and A, which passes straight through +loadrt maxkins +setp maxkins.pivot-length 100 +loadrt walkcheck joints=9 lo=-100,-100,-100,-400,-120,-400,-10,-10,-10 hi=100,100,100,400,120,400,10,10,10 diff --git a/tests/kins-unwrap/maxkins/skip b/tests/kins-unwrap/maxkins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/maxkins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/maxkins/test.sh b/tests/kins-unwrap/maxkins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/maxkins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/millturn/checkresult b/tests/kins-unwrap/millturn/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/millturn/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/millturn/defaults.hal b/tests/kins-unwrap/millturn/defaults.hal new file mode 100644 index 00000000000..73d78a14c94 --- /dev/null +++ b/tests/kins-unwrap/millturn/defaults.hal @@ -0,0 +1,3 @@ +# the module's defaults; the rotary past a whole turn +loadrt millturn +loadrt walkcheck joints=4 lo=-100,-100,-100,-400 hi=100,100,100,400 diff --git a/tests/kins-unwrap/millturn/skip b/tests/kins-unwrap/millturn/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/millturn/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/millturn/test.sh b/tests/kins-unwrap/millturn/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/millturn/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/pentakins/checkresult b/tests/kins-unwrap/pentakins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/pentakins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/pentakins/defaults.hal b/tests/kins-unwrap/pentakins/defaults.hal new file mode 100644 index 00000000000..0fa2b32adbb --- /dev/null +++ b/tests/kins-unwrap/pentakins/defaults.hal @@ -0,0 +1,5 @@ +# a parallel machine, from the pose side; past a = 5 this geometry nears +# a singularity, where the forward can land on another pose with the +# same strut lengths, so a is held below it +loadrt pentakins +loadrt walkcheck joints=5 frompose=1 lo=-20,-20,-10,-15,-15 hi=20,20,10,5,15 diff --git a/tests/kins-unwrap/pentakins/skip b/tests/kins-unwrap/pentakins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/pentakins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/pentakins/test.sh b/tests/kins-unwrap/pentakins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/pentakins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/pumakins/walk-elbow.hal b/tests/kins-unwrap/pumakins/walk-elbow.hal new file mode 100644 index 00000000000..c8b4c2211e7 --- /dev/null +++ b/tests/kins-unwrap/pumakins/walk-elbow.hal @@ -0,0 +1,3 @@ +# the elbow, joint 3, from 150 +loadrt pumakins +loadrt walkcheck start=20,-20,150,30,35,40 mask=4 diff --git a/tests/kins-unwrap/pumakins/walk-shoulder.hal b/tests/kins-unwrap/pumakins/walk-shoulder.hal new file mode 100644 index 00000000000..dd5a96ef51f --- /dev/null +++ b/tests/kins-unwrap/pumakins/walk-shoulder.hal @@ -0,0 +1,3 @@ +# the shoulder, joint 2, from 150 +loadrt pumakins +loadrt walkcheck start=20,150,100,30,35,40 mask=2 diff --git a/tests/kins-unwrap/pumakins/walk-waist.hal b/tests/kins-unwrap/pumakins/walk-waist.hal new file mode 100644 index 00000000000..8f0ad702ef7 --- /dev/null +++ b/tests/kins-unwrap/pumakins/walk-waist.hal @@ -0,0 +1,3 @@ +# the waist, joint 1, from 150 +loadrt pumakins +loadrt walkcheck start=150,-20,100,30,35,40 mask=1 diff --git a/tests/kins-unwrap/pumakins/walk-wrist.hal b/tests/kins-unwrap/pumakins/walk-wrist.hal new file mode 100644 index 00000000000..2a69f0a335a --- /dev/null +++ b/tests/kins-unwrap/pumakins/walk-wrist.hal @@ -0,0 +1,6 @@ +# The walks pumakins-unwrap took for #4585 and #4708. The wrist pitch, +# joint 5, is left out: at +-180 the wrist is folded back on itself, a +# singularity where joints 4 and 6 are not determined. +# joints 4 and 6 together from 150 and 140 +loadrt pumakins +loadrt walkcheck start=20,-20,100,150,35,140 mask=40 diff --git a/tests/kins-unwrap/pumakins/walks b/tests/kins-unwrap/pumakins/walks deleted file mode 100644 index 2d8a217eb5c..00000000000 --- a/tests/kins-unwrap/pumakins/walks +++ /dev/null @@ -1,11 +0,0 @@ -# The walks pumakins-unwrap took for #4585 and #4708. The wrist pitch, -# joint 5, is left out: at +-180 the wrist is folded back on itself, a -# singularity where joints 4 and 6 are not determined. -# joints 4 and 6 together from 150 and 140 -pumakins start=20,-20,100,150,35,140 mask=40 -# the waist, joint 1, from 150 -pumakins start=150,-20,100,30,35,40 mask=1 -# the shoulder, joint 2, from 150 -pumakins start=20,150,100,30,35,40 mask=2 -# the elbow, joint 3, from 150 -pumakins start=20,-20,150,30,35,40 mask=4 diff --git a/tests/kins-unwrap/pumakins/wrist-down.hal b/tests/kins-unwrap/pumakins/wrist-down.hal new file mode 100644 index 00000000000..b38febbce0b --- /dev/null +++ b/tests/kins-unwrap/pumakins/wrist-down.hal @@ -0,0 +1,3 @@ +# as wrist-up.hal, the wrist pitch -170 to -10 +loadrt pumakins +loadrt walkcheck joints=6 lo=-400,-100,-100,-400,-170,-400 hi=400,100,100,400,-10,400 diff --git a/tests/kins-unwrap/pumakins/wrist-up.hal b/tests/kins-unwrap/pumakins/wrist-up.hal new file mode 100644 index 00000000000..64d4bfad2dd --- /dev/null +++ b/tests/kins-unwrap/pumakins/wrist-up.hal @@ -0,0 +1,6 @@ +# the base and the wrist roll past a whole turn; the wrist pitch 10 to +# 170, off the straight and folded wrist where joints 4 and 6 are not +# determined. The forward sets the wrist flip from the pitch's sign, so +# each sign is its own case. +loadrt pumakins +loadrt walkcheck joints=6 lo=-400,-100,-100,-400,10,-400 hi=400,100,100,400,170,400 diff --git a/tests/kins-unwrap/rotarydeltakins/checkresult b/tests/kins-unwrap/rotarydeltakins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/rotarydeltakins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/rotarydeltakins/defaults.hal b/tests/kins-unwrap/rotarydeltakins/defaults.hal new file mode 100644 index 00000000000..d9cabca7dd7 --- /dev/null +++ b/tests/kins-unwrap/rotarydeltakins/defaults.hal @@ -0,0 +1,3 @@ +# a parallel machine, from the pose side; a to w pass straight through +loadrt rotarydeltakins +loadrt walkcheck joints=9 frompose=1 lo=-5,-5,-15,-400,-400,-400,-10,-10,-10 hi=5,5,-8,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/rotarydeltakins/skip b/tests/kins-unwrap/rotarydeltakins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/rotarydeltakins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/rotarydeltakins/test.sh b/tests/kins-unwrap/rotarydeltakins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/rotarydeltakins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/rotatekins/checkresult b/tests/kins-unwrap/rotatekins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/rotatekins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/rotatekins/defaults.hal b/tests/kins-unwrap/rotatekins/defaults.hal new file mode 100644 index 00000000000..836a856ad4f --- /dev/null +++ b/tests/kins-unwrap/rotatekins/defaults.hal @@ -0,0 +1,3 @@ +# one rotation +loadrt rotatekins +loadrt walkcheck joints=9 lo=-100,-100,-100,-400,-400,-400,-10,-10,-10 hi=100,100,100,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/rotatekins/skip b/tests/kins-unwrap/rotatekins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/rotatekins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/rotatekins/test.sh b/tests/kins-unwrap/rotatekins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/rotatekins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/scarakins/sim-limits.hal b/tests/kins-unwrap/scarakins/sim-limits.hal new file mode 100644 index 00000000000..2231c0baf02 --- /dev/null +++ b/tests/kins-unwrap/scarakins/sim-limits.hal @@ -0,0 +1,4 @@ +# the sim arm's own limits on joint 0, and the elbow both ways; a and b +# pass straight through +loadrt scarakins +loadrt walkcheck joints=6 lo=-360,-170,-100,-400,-400,-400 hi=360,170,100,400,400,400 diff --git a/tests/kins-unwrap/scarakins/walk-elbow-neg.hal b/tests/kins-unwrap/scarakins/walk-elbow-neg.hal new file mode 100644 index 00000000000..e8c7dd94e40 --- /dev/null +++ b/tests/kins-unwrap/scarakins/walk-elbow-neg.hal @@ -0,0 +1,3 @@ +# joint 0 across 180 with the elbow bent the other way +loadrt scarakins +loadrt walkcheck start=150,-30,0,0,0,0 mask=1 diff --git a/tests/kins-unwrap/scarakins/walk-elbow-pos.hal b/tests/kins-unwrap/scarakins/walk-elbow-pos.hal new file mode 100644 index 00000000000..0d55fe9e226 --- /dev/null +++ b/tests/kins-unwrap/scarakins/walk-elbow-pos.hal @@ -0,0 +1,3 @@ +# joint 0 across 180 with the elbow bent one way +loadrt scarakins +loadrt walkcheck start=150,30,0,0,0,0 mask=1 diff --git a/tests/kins-unwrap/scarakins/walks b/tests/kins-unwrap/scarakins/walks deleted file mode 100644 index d5f3ec4fe0f..00000000000 --- a/tests/kins-unwrap/scarakins/walks +++ /dev/null @@ -1,3 +0,0 @@ -# joint 0 across 180 with the elbow bent each way -scarakins start=150,30,0,0,0,0 mask=1 -scarakins start=150,-30,0,0,0,0 mask=1 diff --git a/tests/kins-unwrap/scorbot-kins/checkresult b/tests/kins-unwrap/scorbot-kins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/scorbot-kins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/scorbot-kins/one-arm.hal b/tests/kins-unwrap/scorbot-kins/one-arm.hal new file mode 100644 index 00000000000..0ec79942065 --- /dev/null +++ b/tests/kins-unwrap/scorbot-kins/one-arm.hal @@ -0,0 +1,4 @@ +# scorbot-kins solves one arm: the wrist in front of the base and the +# elbow up, which with links of one length means joint 1 above joint 2 +loadrt scorbot-kins +loadrt walkcheck joints=5 lo=-150,40,-85,-90,-400 hi=150,90,30,90,400 diff --git a/tests/kins-unwrap/scorbot-kins/skip b/tests/kins-unwrap/scorbot-kins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/scorbot-kins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/scorbot-kins/test.sh b/tests/kins-unwrap/scorbot-kins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/scorbot-kins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/shared-checkresult b/tests/kins-unwrap/shared-checkresult index 30519ac3a21..7d1f0d13e35 100755 --- a/tests/kins-unwrap/shared-checkresult +++ b/tests/kins-unwrap/shared-checkresult @@ -1,7 +1,8 @@ #!/bin/sh -# every walk in walks ran and held -n=$(grep -cv '^[[:space:]]*\(#\|$\)' "$(dirname "$1")/walks") -[ "$n" -ge 1 ] \ - && [ "$(grep -c '^=== ' "$1")" = "$n" ] \ - && [ "$(grep -c 'joints continuous' "$1")" = "$n" ] \ - && ! grep -q "FAIL" "$1" +# every case ran and held +result=$1 +set -- "$(dirname "$result")"/*.hal +[ -e "$1" ] \ + && [ "$(grep -c '^=== ' "$result")" = "$#" ] \ + && [ "$(grep -c 'round trip holds' "$result")" = "$#" ] \ + && ! grep -q "FAIL" "$result" diff --git a/tests/kins-unwrap/shared-test.sh b/tests/kins-unwrap/shared-test.sh index 7d066e78039..c0d79488265 100755 --- a/tests/kins-unwrap/shared-test.sh +++ b/tests/kins-unwrap/shared-test.sh @@ -1,20 +1,18 @@ #!/bin/bash -# Walk kinematics joints across +-180 the way motion calls them. Each -# line of walks is a module and the walkcheck arguments for one walk. -# One directory per module, so runtests -j runs them side by side. +# Round-trip kinematics modules the way motion calls them, along walks and +# at random points of their range. Each case is a hal file. One directory +# per module, so runtests -j runs them side by side. set -e -[ -r walks ] || { echo "Error: file 'walks' does not exist"; exit 1; } +set -- *.hal +[ -e "$1" ] || { echo "Error: no case files"; exit 1; } halcompile --install ../walkcheck.c >/dev/null -# every walk runs, so one failure does not hide the next +# every case runs, so one failure does not hide the next status=0 -while read -r kins args; do - case "$kins" in ''|'#'*) continue ;; esac - printf 'loadrt %s\nloadrt walkcheck %s\n' "$kins" "$args" > walk.hal - echo "=== $kins $args" - halrun -f walk.hal < /dev/null || status=1 -done < walks -rm -f walk.hal +for f in "$@"; do + echo "=== $f" + halrun -f "$f" < /dev/null || status=1 +done exit $status diff --git a/tests/kins-unwrap/three21kins/walk-elbow.hal b/tests/kins-unwrap/three21kins/walk-elbow.hal new file mode 100644 index 00000000000..bace58fca45 --- /dev/null +++ b/tests/kins-unwrap/three21kins/walk-elbow.hal @@ -0,0 +1,3 @@ +# pumakins' walk-elbow.hal: three21kins carries its solver +loadrt three21kins +loadrt walkcheck start=20,-20,150,30,35,40 mask=4 diff --git a/tests/kins-unwrap/three21kins/walk-shoulder.hal b/tests/kins-unwrap/three21kins/walk-shoulder.hal new file mode 100644 index 00000000000..53966a22142 --- /dev/null +++ b/tests/kins-unwrap/three21kins/walk-shoulder.hal @@ -0,0 +1,3 @@ +# pumakins' walk-shoulder.hal: three21kins carries its solver +loadrt three21kins +loadrt walkcheck start=20,150,100,30,35,40 mask=2 diff --git a/tests/kins-unwrap/three21kins/walk-waist.hal b/tests/kins-unwrap/three21kins/walk-waist.hal new file mode 100644 index 00000000000..aacd86afdd0 --- /dev/null +++ b/tests/kins-unwrap/three21kins/walk-waist.hal @@ -0,0 +1,3 @@ +# pumakins' walk-waist.hal: three21kins carries its solver +loadrt three21kins +loadrt walkcheck start=150,-20,100,30,35,40 mask=1 diff --git a/tests/kins-unwrap/three21kins/walk-wrist.hal b/tests/kins-unwrap/three21kins/walk-wrist.hal new file mode 100644 index 00000000000..29bebcd70b6 --- /dev/null +++ b/tests/kins-unwrap/three21kins/walk-wrist.hal @@ -0,0 +1,3 @@ +# pumakins' walk-wrist.hal: three21kins carries its solver +loadrt three21kins +loadrt walkcheck start=20,-20,100,150,35,140 mask=40 diff --git a/tests/kins-unwrap/three21kins/walks b/tests/kins-unwrap/three21kins/walks deleted file mode 100644 index 8bb37a0b924..00000000000 --- a/tests/kins-unwrap/three21kins/walks +++ /dev/null @@ -1,5 +0,0 @@ -# pumakins' walks: three21kins carries its solver -three21kins start=20,-20,100,150,35,140 mask=40 -three21kins start=150,-20,100,30,35,40 mask=1 -three21kins start=20,150,100,30,35,40 mask=2 -three21kins start=20,-20,150,30,35,40 mask=4 diff --git a/tests/kins-unwrap/three21kins/wrist-down.hal b/tests/kins-unwrap/three21kins/wrist-down.hal new file mode 100644 index 00000000000..3ef263215e7 --- /dev/null +++ b/tests/kins-unwrap/three21kins/wrist-down.hal @@ -0,0 +1,3 @@ +# as pumakins/wrist-down.hal +loadrt three21kins +loadrt walkcheck joints=6 lo=-400,-100,-100,-400,-170,-400 hi=400,100,100,400,-10,400 diff --git a/tests/kins-unwrap/three21kins/wrist-up.hal b/tests/kins-unwrap/three21kins/wrist-up.hal new file mode 100644 index 00000000000..2be8e9fd587 --- /dev/null +++ b/tests/kins-unwrap/three21kins/wrist-up.hal @@ -0,0 +1,3 @@ +# as pumakins/wrist-up.hal: three21kins carries pumakins' solver +loadrt three21kins +loadrt walkcheck joints=6 lo=-400,-100,-100,-400,10,-400 hi=400,100,100,400,170,400 diff --git a/tests/kins-unwrap/tripodkins/checkresult b/tests/kins-unwrap/tripodkins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/tripodkins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/tripodkins/scaled.hal b/tests/kins-unwrap/tripodkins/scaled.hal new file mode 100644 index 00000000000..b45dfe056e5 --- /dev/null +++ b/tests/kins-unwrap/tripodkins/scaled.hal @@ -0,0 +1,7 @@ +# a parallel machine, from the pose side; walkcheck's box is in whole +# units, so the base is scaled up: B at (20, 0), C at (10, 20) +loadrt tripodkins +setp tripodkins.Bx 20 +setp tripodkins.Cx 10 +setp tripodkins.Cy 20 +loadrt walkcheck joints=3 frompose=1 lo=5,5,10 hi=15,15,30 diff --git a/tests/kins-unwrap/tripodkins/skip b/tests/kins-unwrap/tripodkins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/tripodkins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/tripodkins/test.sh b/tests/kins-unwrap/tripodkins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/tripodkins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/trivkins/checkresult b/tests/kins-unwrap/trivkins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/trivkins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/trivkins/gantry.hal b/tests/kins-unwrap/trivkins/gantry.hal new file mode 100644 index 00000000000..689f3634add --- /dev/null +++ b/tests/kins-unwrap/trivkins/gantry.hal @@ -0,0 +1,4 @@ +# the gantry, from the pose side: two joints drive Y, and the inverse +# has to set both +loadrt trivkins coordinates=XYZY kinstype=BOTH +loadrt walkcheck joints=4 frompose=1 lo=-100,-100,-100 hi=100,100,100 diff --git a/tests/kins-unwrap/trivkins/nine-axes.hal b/tests/kins-unwrap/trivkins/nine-axes.hal new file mode 100644 index 00000000000..24f8bc9a2ab --- /dev/null +++ b/tests/kins-unwrap/trivkins/nine-axes.hal @@ -0,0 +1,3 @@ +# the identity on all nine axes +loadrt trivkins coordinates=XYZABCUVW +loadrt walkcheck joints=9 lo=-100,-100,-100,-400,-400,-400,-10,-10,-10 hi=100,100,100,400,400,400,10,10,10 diff --git a/tests/kins-unwrap/trivkins/skip b/tests/kins-unwrap/trivkins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/trivkins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/trivkins/test.sh b/tests/kins-unwrap/trivkins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/trivkins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/walkcheck.c b/tests/kins-unwrap/walkcheck.c index 603b66ac0e3..701a3650538 100644 --- a/tests/kins-unwrap/walkcheck.c +++ b/tests/kins-unwrap/walkcheck.c @@ -1,16 +1,47 @@ -/* Check that a kinematics module keeps its joints continuous (#4585). +/* Check that a kinematics module's inverse returns the joints that made a + * pose, the way motion calls it (#4585), and its forward the pose. * * Loaded after the module under test, so kinematicsForward() and * kinematicsInverse() resolve to it. A failed check fails the load, and * a failed load fails the test. * - * An inverse that takes its joints from atan2(), or from a difference of - * two, lands in (-180, 180] or (-360, 360], so a joint crossing a half - * turn comes back a whole turn away in one call. Walk the joints in mask - * 60 degrees up from start, across +-180, and back down, as motion does: - * take the pose of each step from the forward and hand the inverse the - * joints of the step before. The inverse has to return the joints that - * made the pose, not ones a turn away. + * Take the pose of a set of joints from the forward, then hand the inverse + * that pose, the flags the forward set and a seed near the joints, as + * motion does on the next cycle. The inverse has to return the joints: + * not another branch of the arm, and not a joint a whole turn away, since + * motion would take either as a step and fault on it. + * + * Two ways to pick the joints. A walk (mask) takes the joints in mask 60 + * degrees up from start, across +-180, and back down, each inverse seeded + * with the joints of the step before: an inverse that takes a joint from + * atan2(), or from a difference of two, lands in (-180, 180] or + * (-360, 360], so a joint crossing a half turn comes back a turn away. A + * box (lo, hi) draws 2000 points at random, from a fixed seed so a failure + * repeats, each inverse seeded a servo cycle off the joints. + * + * With frompose=1 the box is in pose space, for the parallel machines and + * the gantry, where a box of joints would hold sets no pose has. Take the + * joints of a pose from the inverse, then hand the forward those joints + * and a seed a cycle off the pose, as motion seeds an iterating forward. + * The forward has to return the pose. These machines' inverses do not + * depend on their seed, so that is the whole check. + * + * Every kinematics type of the module sees the same points. A box should + * keep clear of the module's singularities, where no inverse can be held + * to one answer. It may still cross a singular surface, which random + * points miss; the .hal files say where a box is held back from one. + * + * Module parameters + * joints joint count the module was loaded for + * start, mask a walk: the joints to start from, in degrees, and the + * joints to walk, bit 0 for joint 0 + * lo, hi a box: one pair per joint, or with frompose=1 per pose + * coordinate x y z a b c u v w, in whole units as module + * parameters are integers; a coordinate with lo == hi is + * held there + * frompose 1 for a box of poses, as above + * rseed seed for the draw + * tool x y z of a tool offset motion would hand the module * * Author: LinuxCNC * License: GPL Version 2 @@ -26,97 +57,275 @@ #include #include #include +#include #include MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("kinematics joint unwrap checker"); +MODULE_DESCRIPTION("kinematics round trip checker"); -static int start[6]; -RTAPI_MP_ARRAY_INT(start, 6, "joints to start the walk from"); +static int joints = 6; +RTAPI_MP_INT(joints, "joint count the module under test was loaded for"); -static int mask = 1; +static int start[EMCMOT_MAX_JOINTS]; +RTAPI_MP_ARRAY_INT(start, EMCMOT_MAX_JOINTS, "joints to start the walk from"); + +static int mask = 0; RTAPI_MP_INT(mask, "joints to walk, bit 0 for joint 0"); -/* degrees the inverse may drift from the joints that made the pose; the - round trip is exact, this only covers floating point noise */ +static int lo[EMCMOT_MAX_JOINTS]; +RTAPI_MP_ARRAY_INT(lo, EMCMOT_MAX_JOINTS, "low corner of the box"); + +static int hi[EMCMOT_MAX_JOINTS]; +RTAPI_MP_ARRAY_INT(hi, EMCMOT_MAX_JOINTS, "high corner of the box"); + +static int frompose = 0; +RTAPI_MP_INT(frompose, "1 to draw poses and take the joints from the inverse"); + +static int rseed = 1; +RTAPI_MP_INT(rseed, "seed for the draw"); + +static int tool[3] = { 0, 0, 0 }; +RTAPI_MP_ARRAY_INT(tool, 3, "tool offset x y z, as motion hands it over"); + +/* failures to print in full before only counting them */ +#define MAX_REPORTS 10 +/* points of a box, per kinematics type */ +#define POINTS 2000 +/* a round trip may miss by this */ #define TOL 1e-6 -#define STEP 2.5 +/* a box's seed is this far off in each coordinate: one servo cycle at 1 + unit or degree a second and 1 kHz */ +#define NUDGE 1e-3 +/* a walk's steps, in degrees, and their count each way */ +#define WALK_STEP 2.5 +#define WALK_STEPS 24 static int comp_id = -1; static int failures; -static int poses; +static int points; +static double worst; +static unsigned long long state; + +/* xorshift64*: the same draw on every platform, which rand() is not; its + top 53 bits make a double in [0, 1) */ +static double draw(void) +{ + state ^= state >> 12; + state ^= state << 25; + state ^= state >> 27; + return (double)((state * 2685821657736338717ULL) >> 11) * 0x1p-53; +} + +/* pose coordinate a: x y z a b c u v w */ +static double *pose_axis(EmcPose *p, int a) +{ + double *c[EMCMOT_MAX_AXIS] = { &p->tran.x, &p->tran.y, &p->tran.z, + &p->a, &p->b, &p->c, &p->u, &p->v, &p->w }; + return c[a]; +} -static void step(double *prev, const double *j) +static void fmt(char *buf, int size, const double *v, int count) { - EmcPose world; - double out[6]; + int i, k = 0; + buf[0] = '\0'; + for (i = 0; i < count && k < size; i++) { + k += rtapi_snprintf(buf + k, size - k, "%s%.10g", i ? "," : "", v[i]); + } +} + +/* a failed point; miss is the round trip's, or -1.0 where there is none, + and the test is written so that a NaN miss is still printed */ +static void report(int t, const char *what, const double *at, int at_n, + const double *got, int got_n, double miss) +{ + char a[200], g[200], m[40] = ""; + failures++; + if (failures > MAX_REPORTS) { return; } + fmt(a, sizeof(a), at, at_n); + fmt(g, sizeof(g), got, got_n); + if (!(miss < 0.0)) { rtapi_snprintf(m, sizeof(m), ", a miss of %.3g", miss); } + rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: FAIL type %d %s at [%s] got [%s]%s\n", + t, what, a, g, m); +} + +/* the round trip from joints q, the inverse seeded with r and leaving its + answer there; nonzero where there is no answer */ +static int from_joints(int t, const double *q, double *r) +{ + EmcPose p; KINEMATICS_FORWARD_FLAGS ff = 0; KINEMATICS_INVERSE_FLAGS inf = 0; - double worst = 0.0; + double miss = 0.0; int i; - poses++; - if (kinematicsForward(j, &world, &ff, &inf)) { - rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: FAIL forward at %g %g %g %g %g %g\n", - j[0], j[1], j[2], j[3], j[4], j[5]); - failures++; - return; + points++; + ZERO_EMC_POSE(p); + if (kinematicsForward(q, &p, &ff, &inf)) { + report(t, "forward fails", q, joints, NULL, 0, -1.0); + return -1; } - memcpy(out, prev, sizeof(out)); - if (kinematicsInverse(&world, out, &inf, &ff)) { - rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: FAIL inverse at %g %g %g %g %g %g\n", - j[0], j[1], j[2], j[3], j[4], j[5]); - failures++; - return; + if (kinematicsInverse(&p, r, &inf, &ff)) { + report(t, "inverse fails on the forward's pose", q, joints, NULL, 0, -1.0); + return -1; } - for (i = 0; i < 6; i++) { - if (fabs(out[i] - j[i]) > worst) { worst = fabs(out[i] - j[i]); } + for (i = 0; i < joints; i++) { + double e = fabs(r[i] - q[i]); + if (isnan(e) || e > miss) { miss = e; } } - if (worst > TOL) { - rtapi_print_msg(RTAPI_MSG_ERR, - "walkcheck: FAIL at %g %g %g %g %g %g: got %g %g %g %g %g %g," - " worst joint error %g\n", - j[0], j[1], j[2], j[3], j[4], j[5], - out[0], out[1], out[2], out[3], out[4], out[5], worst); - failures++; + if (miss > worst) { worst = miss; } + if (!(miss <= TOL)) { report(t, "inverse(forward(joints))", q, joints, r, joints, miss); } + return 0; +} + +/* the walk out and back, each inverse seeded with the answer before */ +static void walk(int t) +{ + double q[EMCMOT_MAX_JOINTS], prev[EMCMOT_MAX_JOINTS], r[EMCMOT_MAX_JOINTS]; + int i, n; + + for (i = 0; i < EMCMOT_MAX_JOINTS; i++) { q[i] = prev[i] = start[i]; } + for (n = 0; n <= 2 * WALK_STEPS + 1; n++) { + int s = n <= WALK_STEPS ? n : 2 * WALK_STEPS + 1 - n; + for (i = 0; i < joints; i++) { + if (mask & (1 << i)) { q[i] = start[i] + s * WALK_STEP; } + } + memcpy(r, prev, sizeof(r)); + if (!from_joints(t, q, r)) { memcpy(prev, r, sizeof(prev)); } } - memcpy(prev, out, sizeof(out)); } -static void walk_to(double *j, double *prev, int n) +/* a coordinate of the box, drawn */ +static double coord(int i) { + return lo[i] + (hi[i] - lo[i]) * draw(); +} + +/* a seed coordinate: moved by NUDGE one way or the other */ +static double nudge(void) +{ + return draw() < 0.5 ? -NUDGE : NUDGE; +} + +/* a point of a box of joints, the inverse seeded a cycle off it */ +static void box_joints(int t) +{ + double q[EMCMOT_MAX_JOINTS], r[EMCMOT_MAX_JOINTS]; int i; - for (i = 0; i < 6; i++) { - if (mask & (1 << i)) { j[i] = start[i] + n * STEP; } - } - step(prev, j); + memset(q, 0, sizeof(q)); + for (i = 0; i < joints; i++) { q[i] = coord(i); } + for (i = 0; i < EMCMOT_MAX_JOINTS; i++) { r[i] = q[i] + (i < joints ? nudge() : 0.0); } + from_joints(t, q, r); } -int rtapi_app_main(void) +/* a point of a box of poses */ +static void from_pose(int t) { - double j[6], prev[6]; - int i, n; + double q[EMCMOT_MAX_JOINTS], want[EMCMOT_MAX_AXIS], got[EMCMOT_MAX_AXIS]; + EmcPose p, f; + KINEMATICS_FORWARD_FLAGS ff = 0; + KINEMATICS_INVERSE_FLAGS inf = 0; + double miss = 0.0; + int i; - if (mask <= 0 || mask >= (1 << 6)) { - rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: mask %d must pick from joints 0 to 5\n", mask); - return -EINVAL; + points++; + ZERO_EMC_POSE(p); + for (i = 0; i < EMCMOT_MAX_AXIS; i++) { + want[i] = coord(i); + *pose_axis(&p, i) = want[i]; + } + /* NaN, so a joint the inverse leaves unset shows as one */ + for (i = 0; i < EMCMOT_MAX_JOINTS; i++) { q[i] = nan(""); } + if (kinematicsInverse(&p, q, &inf, &ff)) { + report(t, "inverse fails", want, EMCMOT_MAX_AXIS, NULL, 0, -1.0); + return; + } + for (i = 0; i < joints; i++) { + if (isnan(q[i])) { + report(t, "inverse returns a joint of NaN", want, EMCMOT_MAX_AXIS, q, joints, -1.0); + return; + } + } + f = p; + for (i = 0; i < EMCMOT_MAX_AXIS; i++) { + if (lo[i] != hi[i]) { *pose_axis(&f, i) = want[i] + nudge(); } } + if (kinematicsForward(q, &f, &ff, &inf)) { + report(t, "forward fails on the inverse's joints", want, EMCMOT_MAX_AXIS, q, joints, -1.0); + return; + } + for (i = 0; i < EMCMOT_MAX_AXIS; i++) { + double e; + got[i] = *pose_axis(&f, i); + e = fabs(got[i] - want[i]); + if (isnan(e) || e > miss) { miss = e; } + } + if (miss > worst) { worst = miss; } + if (!(miss <= TOL)) { + report(t, "forward(inverse(pose))", want, EMCMOT_MAX_AXIS, got, EMCMOT_MAX_AXIS, miss); + } +} + +static int bad(const char *why) +{ + rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: %s\n", why); + hal_exit(comp_id); + return -EINVAL; +} + +int rtapi_app_main(void) +{ + int t, k, n, box = 0, checked = 0; comp_id = hal_init("walkcheck"); if (comp_id < 0) { return comp_id; } - for (i = 0; i < 6; i++) { j[i] = prev[i] = start[i]; } - for (n = 0; n <= 24; n++) { walk_to(j, prev, n); } - for (n = 24; n >= 0; n--) { walk_to(j, prev, n); } + if (joints < 1 || joints > EMCMOT_MAX_JOINTS) { return bad("bad joints"); } + if (mask < 0 || mask >= (1 << joints)) { return bad("mask picks a joint past joints"); } + for (k = 0; k < EMCMOT_MAX_JOINTS; k++) { box |= lo[k] != hi[k]; } + if (!mask == !box) { return bad("give a walk (mask) or a box (lo, hi), one of them"); } + if (mask && frompose) { return bad("a walk is of joints, not poses"); } + + /* a tool offset, for the modules that turn it with the head; both + directions see it, as both do in motion */ + if (tool[0] || tool[1] || tool[2]) { + EmcPose offset = { { tool[0], tool[1], tool[2] }, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + if (kinematicsSetTool(&offset)) { return bad("kinematicsSetTool failed"); } + } + + for (t = 0; t < SWITCHKINS_MAX_TYPES; t++) { + /* the module starts in type 0; past its last type, or for a module + that does not switch, the flags are -1 */ + if (t > 0 && kinematicsTypeFlags(t) < 0) { break; } + if (t > 0 && kinematicsSwitch(t)) { + rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: FAIL switching to type %d\n", t); + failures++; + break; + } + checked++; + /* every type sees the same points; the odd constant keeps the + state nonzero */ + state = 0x9E3779B97F4A7C15ULL ^ (unsigned long long)(unsigned)rseed; + worst = 0.0; + k = points; + if (mask) { + walk(t); + } else { + for (n = 0; n < POINTS; n++) { + if (frompose) { from_pose(t); } else { box_joints(t); } + } + } + rtapi_print("walkcheck: type %d worst miss %.3g over %d points\n", t, worst, points - k); + } if (failures) { - rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: %d of %d pose(s) failed\n", - failures, poses); + rtapi_print_msg(RTAPI_MSG_ERR, "walkcheck: %d of %d point(s) failed\n", + failures, points); hal_exit(comp_id); return -ERANGE; } - rtapi_print("walkcheck: joints continuous over %d pose(s)\n", poses); + rtapi_print("walkcheck: round trip holds for %d kinematics type(s), %d point(s)\n", + checked, points); hal_ready(comp_id); return 0; } diff --git a/tests/kins-unwrap/xyzab_tdr_kins/checkresult b/tests/kins-unwrap/xyzab_tdr_kins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/xyzab_tdr_kins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/xyzab_tdr_kins/offsets.hal b/tests/kins-unwrap/xyzab_tdr_kins/offsets.hal new file mode 100644 index 00000000000..8499a224336 --- /dev/null +++ b/tests/kins-unwrap/xyzab_tdr_kins/offsets.hal @@ -0,0 +1,8 @@ +# offsets and a tool length set; both tilts to 120 +loadrt xyzab_tdr_kins +setp xyzab_tdr_kins.z-offset 11 +setp xyzab_tdr_kins.tool-offset-z 7 +setp xyzab_tdr_kins.x-rot-point 1 +setp xyzab_tdr_kins.y-rot-point 2 +setp xyzab_tdr_kins.z-rot-point 5 +loadrt walkcheck joints=5 lo=-100,-100,-100,-120,-120 hi=100,100,100,120,120 diff --git a/tests/kins-unwrap/xyzab_tdr_kins/skip b/tests/kins-unwrap/xyzab_tdr_kins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/xyzab_tdr_kins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/xyzab_tdr_kins/test.sh b/tests/kins-unwrap/xyzab_tdr_kins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/xyzab_tdr_kins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/xyzac-trt-kins/checkresult b/tests/kins-unwrap/xyzac-trt-kins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/xyzac-trt-kins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/xyzac-trt-kins/conventional.hal b/tests/kins-unwrap/xyzac-trt-kins/conventional.hal new file mode 100644 index 00000000000..ae1fe65fc6b --- /dev/null +++ b/tests/kins-unwrap/xyzac-trt-kins/conventional.hal @@ -0,0 +1,10 @@ +# as tool-pin.hal with the conventional directions, and the tool +# offset handed over as motion does +loadrt xyzac-trt-kins coordinates=XYZAC +setp xyzac-trt-kins.conventional-directions 1 +setp xyzac-trt-kins.y-offset 3 +setp xyzac-trt-kins.z-offset 11 +setp xyzac-trt-kins.x-rot-point 1 +setp xyzac-trt-kins.y-rot-point 2 +setp xyzac-trt-kins.z-rot-point 5 +loadrt walkcheck joints=5 tool=4,3,7 lo=-100,-100,-100,-120,-400 hi=100,100,100,120,400 diff --git a/tests/kins-unwrap/xyzac-trt-kins/skip b/tests/kins-unwrap/xyzac-trt-kins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/xyzac-trt-kins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/xyzac-trt-kins/test.sh b/tests/kins-unwrap/xyzac-trt-kins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/xyzac-trt-kins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/xyzac-trt-kins/tool-pin.hal b/tests/kins-unwrap/xyzac-trt-kins/tool-pin.hal new file mode 100644 index 00000000000..cb14cdab8d9 --- /dev/null +++ b/tests/kins-unwrap/xyzac-trt-kins/tool-pin.hal @@ -0,0 +1,10 @@ +# offsets set so no term drops out; the tilt to 120, the turn past a +# whole one; the tool offset set on its pin +loadrt xyzac-trt-kins coordinates=XYZAC +setp xyzac-trt-kins.y-offset 3 +setp xyzac-trt-kins.z-offset 11 +setp xyzac-trt-kins.tool-offset 7 +setp xyzac-trt-kins.x-rot-point 1 +setp xyzac-trt-kins.y-rot-point 2 +setp xyzac-trt-kins.z-rot-point 5 +loadrt walkcheck joints=5 lo=-100,-100,-100,-120,-400 hi=100,100,100,120,400 diff --git a/tests/kins-unwrap/xyzacb_trsrn/checkresult b/tests/kins-unwrap/xyzacb_trsrn/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/xyzacb_trsrn/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/xyzacb_trsrn/skip b/tests/kins-unwrap/xyzacb_trsrn/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/xyzacb_trsrn/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/xyzacb_trsrn/test.sh b/tests/kins-unwrap/xyzacb_trsrn/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/xyzacb_trsrn/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/xyzacb_trsrn/tool-motion.hal b/tests/kins-unwrap/xyzacb_trsrn/tool-motion.hal new file mode 100644 index 00000000000..8f79252f44a --- /dev/null +++ b/tests/kins-unwrap/xyzacb_trsrn/tool-motion.hal @@ -0,0 +1,13 @@ +# as tool-pin.hal, with the tool offset handed over as motion does +loadrt xyzacb_trsrn +setp xyzacb_trsrn_kins.nut-angle 45 +setp xyzacb_trsrn_kins.y-pivot 100 +setp xyzacb_trsrn_kins.z-pivot 200 +setp xyzacb_trsrn_kins.x-offset 5 +setp xyzacb_trsrn_kins.y-offset 7 +setp xyzacb_trsrn_kins.y-rot-axis 300 +setp xyzacb_trsrn_kins.z-rot-axis 400 +setp xyzacb_trsrn_kins.pre-rot 0.3 +setp xyzacb_trsrn_kins.primary-angle 20 +setp xyzacb_trsrn_kins.secondary-angle 35 +loadrt walkcheck joints=6 tool=4,3,50 lo=-100,-100,-100,-400,-400,-400 hi=100,100,100,400,400,400 diff --git a/tests/kins-unwrap/xyzacb_trsrn/tool-pin.hal b/tests/kins-unwrap/xyzacb_trsrn/tool-pin.hal new file mode 100644 index 00000000000..bec4ac0e7cf --- /dev/null +++ b/tests/kins-unwrap/xyzacb_trsrn/tool-pin.hal @@ -0,0 +1,15 @@ +# a nutating head: the pose carries the rotary joints unchanged, so all +# three go past a whole turn; the tool offset set on its pin +loadrt xyzacb_trsrn +setp xyzacb_trsrn_kins.nut-angle 45 +setp xyzacb_trsrn_kins.y-pivot 100 +setp xyzacb_trsrn_kins.z-pivot 200 +setp xyzacb_trsrn_kins.x-offset 5 +setp xyzacb_trsrn_kins.y-offset 7 +setp xyzacb_trsrn_kins.y-rot-axis 300 +setp xyzacb_trsrn_kins.z-rot-axis 400 +setp xyzacb_trsrn_kins.tool-offset-z 50 +setp xyzacb_trsrn_kins.pre-rot 0.3 +setp xyzacb_trsrn_kins.primary-angle 20 +setp xyzacb_trsrn_kins.secondary-angle 35 +loadrt walkcheck joints=6 lo=-100,-100,-100,-400,-400,-400 hi=100,100,100,400,400,400 diff --git a/tests/kins-unwrap/xyzbc-trt-kins/checkresult b/tests/kins-unwrap/xyzbc-trt-kins/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/xyzbc-trt-kins/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbc-trt-kins/conventional.hal b/tests/kins-unwrap/xyzbc-trt-kins/conventional.hal new file mode 100644 index 00000000000..98a1828cb8c --- /dev/null +++ b/tests/kins-unwrap/xyzbc-trt-kins/conventional.hal @@ -0,0 +1,10 @@ +# as tool-pin.hal with the conventional directions, and the tool +# offset handed over as motion does +loadrt xyzbc-trt-kins coordinates=XYZBC +setp xyzbc-trt-kins.conventional-directions 1 +setp xyzbc-trt-kins.x-offset 3 +setp xyzbc-trt-kins.z-offset 11 +setp xyzbc-trt-kins.x-rot-point 1 +setp xyzbc-trt-kins.y-rot-point 2 +setp xyzbc-trt-kins.z-rot-point 5 +loadrt walkcheck joints=5 tool=4,3,7 lo=-100,-100,-100,-120,-400 hi=100,100,100,120,400 diff --git a/tests/kins-unwrap/xyzbc-trt-kins/skip b/tests/kins-unwrap/xyzbc-trt-kins/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/xyzbc-trt-kins/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbc-trt-kins/test.sh b/tests/kins-unwrap/xyzbc-trt-kins/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/xyzbc-trt-kins/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbc-trt-kins/tool-pin.hal b/tests/kins-unwrap/xyzbc-trt-kins/tool-pin.hal new file mode 100644 index 00000000000..4738bdc8c2f --- /dev/null +++ b/tests/kins-unwrap/xyzbc-trt-kins/tool-pin.hal @@ -0,0 +1,10 @@ +# offsets set so no term drops out; the tilt to 120, the turn past a +# whole one; the tool offset set on its pin +loadrt xyzbc-trt-kins coordinates=XYZBC +setp xyzbc-trt-kins.x-offset 3 +setp xyzbc-trt-kins.z-offset 11 +setp xyzbc-trt-kins.tool-offset 7 +setp xyzbc-trt-kins.x-rot-point 1 +setp xyzbc-trt-kins.y-rot-point 2 +setp xyzbc-trt-kins.z-rot-point 5 +loadrt walkcheck joints=5 lo=-100,-100,-100,-120,-400 hi=100,100,100,120,400 diff --git a/tests/kins-unwrap/xyzbca_trsrn/checkresult b/tests/kins-unwrap/xyzbca_trsrn/checkresult new file mode 120000 index 00000000000..c4fbef14529 --- /dev/null +++ b/tests/kins-unwrap/xyzbca_trsrn/checkresult @@ -0,0 +1 @@ +../shared-checkresult \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbca_trsrn/skip b/tests/kins-unwrap/xyzbca_trsrn/skip new file mode 120000 index 00000000000..27cf8a6dbbe --- /dev/null +++ b/tests/kins-unwrap/xyzbca_trsrn/skip @@ -0,0 +1 @@ +../shared-skip \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbca_trsrn/test.sh b/tests/kins-unwrap/xyzbca_trsrn/test.sh new file mode 120000 index 00000000000..0b01664e62e --- /dev/null +++ b/tests/kins-unwrap/xyzbca_trsrn/test.sh @@ -0,0 +1 @@ +../shared-test.sh \ No newline at end of file diff --git a/tests/kins-unwrap/xyzbca_trsrn/tool-motion.hal b/tests/kins-unwrap/xyzbca_trsrn/tool-motion.hal new file mode 100644 index 00000000000..77230215c57 --- /dev/null +++ b/tests/kins-unwrap/xyzbca_trsrn/tool-motion.hal @@ -0,0 +1,13 @@ +# as tool-pin.hal, with the tool offset handed over as motion does +loadrt xyzbca_trsrn +setp xyzbca_trsrn_kins.nut-angle 45 +setp xyzbca_trsrn_kins.x-pivot 100 +setp xyzbca_trsrn_kins.z-pivot 200 +setp xyzbca_trsrn_kins.x-offset 5 +setp xyzbca_trsrn_kins.y-offset 7 +setp xyzbca_trsrn_kins.x-rot-axis 300 +setp xyzbca_trsrn_kins.z-rot-axis 400 +setp xyzbca_trsrn_kins.pre-rot 0.3 +setp xyzbca_trsrn_kins.primary-angle 20 +setp xyzbca_trsrn_kins.secondary-angle 35 +loadrt walkcheck joints=6 tool=4,3,50 lo=-100,-100,-100,-400,-400,-400 hi=100,100,100,400,400,400 diff --git a/tests/kins-unwrap/xyzbca_trsrn/tool-pin.hal b/tests/kins-unwrap/xyzbca_trsrn/tool-pin.hal new file mode 100644 index 00000000000..9a5109b5533 --- /dev/null +++ b/tests/kins-unwrap/xyzbca_trsrn/tool-pin.hal @@ -0,0 +1,15 @@ +# a nutating head: the pose carries the rotary joints unchanged, so all +# three go past a whole turn; the tool offset set on its pin +loadrt xyzbca_trsrn +setp xyzbca_trsrn_kins.nut-angle 45 +setp xyzbca_trsrn_kins.x-pivot 100 +setp xyzbca_trsrn_kins.z-pivot 200 +setp xyzbca_trsrn_kins.x-offset 5 +setp xyzbca_trsrn_kins.y-offset 7 +setp xyzbca_trsrn_kins.x-rot-axis 300 +setp xyzbca_trsrn_kins.z-rot-axis 400 +setp xyzbca_trsrn_kins.tool-offset-z 50 +setp xyzbca_trsrn_kins.pre-rot 0.3 +setp xyzbca_trsrn_kins.primary-angle 20 +setp xyzbca_trsrn_kins.secondary-angle 35 +loadrt walkcheck joints=6 lo=-100,-100,-100,-400,-400,-400 hi=100,100,100,400,400,400