diff --git a/src/hal/components/Submakefile b/src/hal/components/Submakefile index b9c0e5283d4..8cc3062575e 100644 --- a/src/hal/components/Submakefile +++ b/src/hal/components/Submakefile @@ -81,7 +81,6 @@ obj-m += $(patsubst hal/drivers/%.comp, %.o, $(patsubst hal/components/%.comp, % # so it has to be defined in this file (which the .mak depends on). SWITCHKINS_OBJS := emc/kinematics/switchkins.o emc/kinematics/switchkins_setup.o emc/kinematics/kins_util.o matrixkins-extra-objs := emc/kinematics/kins_util.o emc/kinematics/kins_single.o emc/kinematics/kins_single_module.o -userkins-extra-objs := emc/kinematics/kins_util.o emc/kinematics/kins_single.o millturn-extra-objs := $(SWITCHKINS_OBJS) xyzab_tdr_kins-extra-objs := $(SWITCHKINS_OBJS) xyzacb_trsrn-extra-objs := $(SWITCHKINS_OBJS) diff --git a/src/hal/components/userkins.comp b/src/hal/components/userkins.comp index aab96ac010a..5099096b960 100644 --- a/src/hal/components/userkins.comp +++ b/src/hal/components/userkins.comp @@ -42,17 +42,14 @@ JOINTS=3 # number of joints used in your modified userkins.comp ---- -A module built with halcompile takes the shared code from the -kins_single_core module, which the HAL file loads ahead of it: +The module takes the shared code from the kins_single_core module, +which the HAL file loads ahead of it: ---- loadrt kins_single_core loadrt [KINS]KINEMATICS ---- -The userkins built in tree has that code linked in and needs no -kins_single_core. - Note: the manpage for userkins is not updated by `halcompile --install` To use a different component name, rename the file (example mykins.comp) and diff --git a/tests/kins-jacobian/test.sh b/tests/kins-jacobian/test.sh index 7b7a4b49be8..003a18940c3 100755 --- a/tests/kins-jacobian/test.sh +++ b/tests/kins-jacobian/test.sh @@ -13,7 +13,8 @@ run() { local hal case "$1" in "${ONLY:-}"*) ;; *) return 0 ;; esac hal=$(mktemp --suffix=.hal) - { printf 'loadrt %s\n' "$1" + { if [ -n "${CORE:-}" ]; then printf 'loadrt %s\n' "$CORE"; fi + printf 'loadrt %s\n' "$1" printf '%s\n' "$2" printf 'loadrt jaccheck %s\n' "$3" } > "$hal" @@ -27,7 +28,7 @@ run() { run "trivkins coordinates=XYZ" "" "joints=3" run "trivkins coordinates=XYZY kinstype=BOTH" "" "joints=4 check=inv" run "trivkins coordinates=XYZABCUVW" "" "joints=9 r1=3 r2=5" -run "userkins" "" "joints=3" +CORE=kins_single_core run "userkins" "" "joints=3" run "millturn" "" "joints=4" # linear maps and one rotation diff --git a/tests/kins-params/5axiskins/checkresult b/tests/kins-params/5axiskins/checkresult new file mode 100755 index 00000000000..8da1c487a9e --- /dev/null +++ b/tests/kins-params/5axiskins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 4 2 diff --git a/tests/kins-params/skip b/tests/kins-params/5axiskins/skip similarity index 100% rename from tests/kins-params/skip rename to tests/kins-params/5axiskins/skip diff --git a/tests/kins-params/5axiskins/test.sh b/tests/kins-params/5axiskins/test.sh new file mode 100755 index 00000000000..f39b0c4f6e3 --- /dev/null +++ b/tests/kins-params/5axiskins/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e +. ../lib.sh + +# tables and heads, offsets set so no term drops out +run "5axiskins coordinates=XYZBCW" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3" +run "5axiskins coordinates=XYZBCW sparm=identityfirst" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3" 1 + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "5axiskins coordinates=XYZBCW" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3 tool=4,3,12" +run "5axiskins coordinates=XYZBCW sparm=identityfirst" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3 tool=4,3,12" 1 diff --git a/tests/kins-params/check.py b/tests/kins-params/check.py index 5a514e9d8a4..9ba70f22967 100755 --- a/tests/kins-params/check.py +++ b/tests/kins-params/check.py @@ -21,6 +21,8 @@ import hal EMC2_HOME = os.environ.get("EMC2_HOME") +# the realtime checker, built under its test's name +CHECKER = os.environ.get("PARITYCHECK", "paritycheck") # local, the way a GUI holds them under the interpreter it loads: what a # module needs in scope, the HAL library and an out of tree module's core, # the loader puts there itself @@ -109,9 +111,9 @@ def compare(what, ours, theirs): if not close(ours, theirs): fail("%s: loader %.12g, realtime %.12g" % (what, ours, theirs)) -rc_fwd = hal.get_value("paritycheck.rc-fwd") -rc_inv = hal.get_value("paritycheck.rc-inv") -rc_jac = hal.get_value("paritycheck.rc-jac") +rc_fwd = hal.get_value(CHECKER + ".rc-fwd") +rc_inv = hal.get_value(CHECKER + ".rc-inv") +rc_jac = hal.get_value(CHECKER + ".rc-jac") q = Joints(*jnt_in) qi = Joints(*jnt_in) @@ -135,14 +137,14 @@ def compare(what, ours, theirs): if r_fwd == 0 and rc_fwd == 0: for n in "xyzabcuvw": - compare("forward %s" % n, getattr(F, n), hal.get_value("paritycheck.fwd-%s" % n)) + compare("forward %s" % n, getattr(F, n), hal.get_value(CHECKER + ".fwd-%s" % n)) if r_inv == 0 and rc_inv == 0: for j in range(joints): - compare("inverse joint %d" % j, qi[j], hal.get_value("paritycheck.inv-%d" % j)) + compare("inverse joint %d" % j, qi[j], hal.get_value(CHECKER + ".inv-%d" % j)) if r_jac == 0 and rc_jac == 0: for j in range(joints): for a, n in enumerate("xyzabcuvw"): - compare("jacobian [%d][%s]" % (j, n), J[j][a], hal.get_value("paritycheck.jac-%d-%s" % (j, n))) + compare("jacobian [%d][%s]" % (j, n), J[j][a], hal.get_value(CHECKER + ".jac-%d-%s" % (j, n))) # the caller's tool wins over the module's pin: for a module with a tool # entry, a length of the caller's must move the inverse, and handing the diff --git a/tests/kins-params/checkresult b/tests/kins-params/checkresult deleted file mode 100755 index 08d80381330..00000000000 --- a/tests/kins-params/checkresult +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -[ "$(grep -c 'agrees' "$1")" = "$(grep -c '^=== ' "$1")" ] \ - && [ "$(grep -c '^=== ' "$1")" -ge 20 ] \ - && [ "$(grep -c 'turns the offset across the tool' "$1")" = "$(grep -c '^=== .* tool ' "$1")" ] \ - && [ "$(grep -c '^=== .* tool ' "$1")" -ge 6 ] \ - && ! grep -q "FAIL" "$1" diff --git a/tests/kins-params/checkresult.sh b/tests/kins-params/checkresult.sh new file mode 100755 index 00000000000..bc800042c39 --- /dev/null +++ b/tests/kins-params/checkresult.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# checkresult for each module: every entry agrees, at least $2 entries +# ran, and every tool offset entry, at least $3 of them, turned the +# offset with the tool +r=$1 min=$2 mintool=$3 +n=$(grep -c '^=== ' "$r") +tool=$(grep -c '^=== .* tool ' "$r") +[ "$(grep -c 'agrees' "$r")" = "$n" ] \ + && [ "$n" -ge "$min" ] \ + && [ "$(grep -c 'turns the offset across the tool' "$r")" = "$tool" ] \ + && [ "$tool" -ge "$mintool" ] \ + && ! grep -q "FAIL" "$r" diff --git a/tests/kins-params/corexykins/checkresult b/tests/kins-params/corexykins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/corexykins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/corexykins/skip b/tests/kins-params/corexykins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/corexykins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/corexykins/test.sh b/tests/kins-params/corexykins/test.sh new file mode 100755 index 00000000000..6c01b88f116 --- /dev/null +++ b/tests/kins-params/corexykins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# linear maps and one rotation +run "corexykins" "" "joints=9" diff --git a/tests/kins-params/genhexkins/checkresult b/tests/kins-params/genhexkins/checkresult new file mode 100755 index 00000000000..b0e4e73565e --- /dev/null +++ b/tests/kins-params/genhexkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 0 diff --git a/tests/kins-params/genhexkins/skip b/tests/kins-params/genhexkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/genhexkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/genhexkins/test.sh b/tests/kins-params/genhexkins/test.sh new file mode 100755 index 00000000000..c407eba8da4 --- /dev/null +++ b/tests/kins-params/genhexkins/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +. ../lib.sh + +# parallel machines, from a pose the forward can be seeded with +run "genhexkins" "setp genhexkins.screw-lead 0" "joints=6 frompose=1 pose=2,3,20,0,5,-7" +run "genhexkins" "setp genhexkins.screw-lead 5" "joints=6 frompose=1 pose=2,3,20,0,5,-7" diff --git a/tests/kins-params/genserkins/checkresult b/tests/kins-params/genserkins/checkresult new file mode 100755 index 00000000000..b0e4e73565e --- /dev/null +++ b/tests/kins-params/genserkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 0 diff --git a/tests/kins-params/genserkins/skip b/tests/kins-params/genserkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/genserkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/genserkins/test.sh b/tests/kins-params/genserkins/test.sh new file mode 100755 index 00000000000..9a2bc155f74 --- /dev/null +++ b/tests/kins-params/genserkins/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +. ../lib.sh + +# arms +run "genserkins" "" "joints=9 jnt=15,20,-35,10,70,20,0,0,0 orient=-" +run "genserkins" "setp genserkins.unrotate-3 1" "joints=9 jnt=15,20,-35,10,70,20,0,0,0 orient=-" diff --git a/tests/kins-params/lib.sh b/tests/kins-params/lib.sh new file mode 100644 index 00000000000..ed1b99a141d --- /dev/null +++ b/tests/kins-params/lib.sh @@ -0,0 +1,70 @@ +# Sourced by the test.sh of each module's directory. Each builds the +# realtime checker under its own name, paritycheck_ and the directory, +# so tests running side by side never install over a module another one +# is loading. +KP=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +PARITYCHECK=paritycheck_$(basename "$PWD" | tr - _) +export PARITYCHECK +sed "s/paritycheck/$PARITYCHECK/g" "$KP/paritycheck.c" > "$PARITYCHECK.c" +halcompile --install "$PARITYCHECK.c" >/dev/null +rm -f "$PARITYCHECK.c" + +# One hal file per module. The checker evaluates the module in realtime +# through the classic entry points and publishes the answers; check.py +# evaluates it through the non-realtime loader, kinsDescribe() and the +# parameter block, and compares. Where they disagree the module keeps +# state its table does not declare. +# ONLY= in the environment runs the entries for that module alone +run() { + local loadrt="$1" setp="$2" parms="$3" ktype="$4" + local module coords sparm joints frompose pose jnt orient posejoint tool rtparms hal tok + case "$loadrt" in "${ONLY:-}"*) ;; *) return 0 ;; esac + module=${loadrt%% *} + coords=""; sparm="" + for tok in $loadrt; do + case "$tok" in + coordinates=*) coords=${tok#coordinates=} ;; + sparm=*) sparm=${tok#sparm=} ;; + esac + done + joints=3; frompose=0; pose="0,0,0,0,0,0,0,0,0"; jnt="10,20,30,40,50,60,70,80,90" + # the two rotaries that orient the tool, "primary,secondary", or "-" + # where the machine has no such pair and "no-frame" where the module + # reports no tool frame at all, which most of the tree still does + orient="no-frame" + # the rotary whose sign G53.1 P names, the same three ways; where the + # entry gives none, what it gives for the pair + posejoint="" + # a tool offset x,y,z both sides evaluate under, as motion hands it over + tool="-" + for tok in $parms; do + case "$tok" in + joints=*) joints=${tok#joints=} ;; + frompose=*) frompose=${tok#frompose=} ;; + pose=*) pose=${tok#pose=} ;; + jnt=*) jnt=${tok#jnt=} ;; + orient=*) orient=${tok#orient=} ;; + posejoint=*) posejoint=${tok#posejoint=} ;; + tool=*) tool=${tok#tool=} ;; + esac + done + [ -n "$posejoint" ] || posejoint=$orient + # what the module under test is loaded with: everything but our own words + rtparms=$(printf ' %s ' "$parms" | sed 's/ orient=[^ ]*//g; s/ posejoint=[^ ]*//g') + hal=$(mktemp --suffix=.hal) + { if [ -n "${CORE:-}" ]; then printf 'loadrt %s\n' "$CORE"; fi + printf 'loadrt %s\n' "$loadrt" + printf '%s\n' "$setp" + printf 'loadrt %s %s ktype=%s\n' "$PARITYCHECK" "$rtparms" "${ktype:-0}" + # halcmd keeps quotes, so an absent value travels as a dash + printf 'loadusr -w python3 %s/check.py %s %s %s %s %s %s %s %s %s %s %s\n' \ + "$KP" "$module" "$joints" "${coords:--}" "${ktype:-0}" "$frompose" "$pose" "$jnt" "${sparm:--}" "$orient" "$posejoint" "$tool" + } > "$hal" + if [ "$tool" = "-" ]; then + echo "=== $loadrt type ${ktype:-0}" + else + echo "=== $loadrt type ${ktype:-0} tool $tool" + fi + halrun -f "$hal" + rm -f "$hal" +} diff --git a/tests/kins-params/lineardeltakins/checkresult b/tests/kins-params/lineardeltakins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/lineardeltakins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/lineardeltakins/skip b/tests/kins-params/lineardeltakins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/lineardeltakins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/lineardeltakins/test.sh b/tests/kins-params/lineardeltakins/test.sh new file mode 100755 index 00000000000..4fba6f7d058 --- /dev/null +++ b/tests/kins-params/lineardeltakins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# parallel machines, from a pose the forward can be seeded with +run "lineardeltakins" "" "joints=9 frompose=1 pose=20,30,-200" diff --git a/tests/kins-params/matrixkins/checkresult b/tests/kins-params/matrixkins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/matrixkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/matrixkins/skip b/tests/kins-params/matrixkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/matrixkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/matrixkins/test.sh b/tests/kins-params/matrixkins/test.sh new file mode 100755 index 00000000000..15a437796dd --- /dev/null +++ b/tests/kins-params/matrixkins/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +. ../lib.sh + +# linear maps and one rotation +run "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" \ + "joints=9" diff --git a/tests/kins-params/maxkins/checkresult b/tests/kins-params/maxkins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/maxkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/maxkins/skip b/tests/kins-params/maxkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/maxkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/maxkins/test.sh b/tests/kins-params/maxkins/test.sh new file mode 100755 index 00000000000..fb32dc59721 --- /dev/null +++ b/tests/kins-params/maxkins/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +. ../lib.sh + +# tables and heads, offsets set so no term drops out +run "maxkins" \ + "setp maxkins.pivot-length 100" \ + "joints=9 jnt=10,20,30,0,15,25,7,0,3 orient=- posejoint=4" diff --git a/tests/kins-params/millturn/checkresult b/tests/kins-params/millturn/checkresult new file mode 100755 index 00000000000..b0e4e73565e --- /dev/null +++ b/tests/kins-params/millturn/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 0 diff --git a/tests/kins-params/millturn/skip b/tests/kins-params/millturn/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/millturn/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/millturn/test.sh b/tests/kins-params/millturn/test.sh new file mode 100755 index 00000000000..ddf8ee6cc77 --- /dev/null +++ b/tests/kins-params/millturn/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +. ../lib.sh + +# identity, a gantry included +run "millturn" "" "joints=4 jnt=10,20,30,40 orient=-" +run "millturn" "" "joints=4 jnt=10,20,30,40" 1 diff --git a/tests/kins-params/pentakins/checkresult b/tests/kins-params/pentakins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/pentakins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/pentakins/skip b/tests/kins-params/pentakins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/pentakins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/pentakins/test.sh b/tests/kins-params/pentakins/test.sh new file mode 100755 index 00000000000..6592dcc4c46 --- /dev/null +++ b/tests/kins-params/pentakins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# parallel machines, from a pose the forward can be seeded with +run "pentakins" "" "joints=5 frompose=1 pose=10,20,0,5,-7" diff --git a/tests/kins-params/pumakins/checkresult b/tests/kins-params/pumakins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/pumakins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/pumakins/skip b/tests/kins-params/pumakins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/pumakins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/pumakins/test.sh b/tests/kins-params/pumakins/test.sh new file mode 100755 index 00000000000..40d5c1d1cab --- /dev/null +++ b/tests/kins-params/pumakins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# arms +run "pumakins" "setp pumakins.D6 50" "joints=6 jnt=15,20,-35,10,70,20 orient=-" diff --git a/tests/kins-params/rosekins/checkresult b/tests/kins-params/rosekins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/rosekins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/rosekins/skip b/tests/kins-params/rosekins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/rosekins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/rosekins/test.sh b/tests/kins-params/rosekins/test.sh new file mode 100755 index 00000000000..623183019af --- /dev/null +++ b/tests/kins-params/rosekins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# polar +run "rosekins" "" "joints=3 jnt=10,5,30" diff --git a/tests/kins-params/rotarydeltakins/checkresult b/tests/kins-params/rotarydeltakins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/rotarydeltakins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/rotarydeltakins/skip b/tests/kins-params/rotarydeltakins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/rotarydeltakins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/rotarydeltakins/test.sh b/tests/kins-params/rotarydeltakins/test.sh new file mode 100755 index 00000000000..98b9bb0685b --- /dev/null +++ b/tests/kins-params/rotarydeltakins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# parallel machines, from a pose the forward can be seeded with +run "rotarydeltakins" "" "joints=9 frompose=1 pose=0,0,-12" diff --git a/tests/kins-params/rotatekins/checkresult b/tests/kins-params/rotatekins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/rotatekins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/rotatekins/skip b/tests/kins-params/rotatekins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/rotatekins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/rotatekins/test.sh b/tests/kins-params/rotatekins/test.sh new file mode 100755 index 00000000000..9ab7fc55f54 --- /dev/null +++ b/tests/kins-params/rotatekins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# linear maps and one rotation +run "rotatekins" "" "joints=9" diff --git a/tests/kins-params/scarakins/checkresult b/tests/kins-params/scarakins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/scarakins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/scarakins/skip b/tests/kins-params/scarakins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/scarakins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/scarakins/test.sh b/tests/kins-params/scarakins/test.sh new file mode 100755 index 00000000000..6b0d9242f35 --- /dev/null +++ b/tests/kins-params/scarakins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# arms +run "scarakins" "" "joints=6 jnt=30,40,20,10,0,0" diff --git a/tests/kins-params/scorbot-kins/checkresult b/tests/kins-params/scorbot-kins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/scorbot-kins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/scorbot-kins/skip b/tests/kins-params/scorbot-kins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/scorbot-kins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/scorbot-kins/test.sh b/tests/kins-params/scorbot-kins/test.sh new file mode 100755 index 00000000000..55b329708f5 --- /dev/null +++ b/tests/kins-params/scorbot-kins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# arms +run "scorbot-kins" "" "joints=5 jnt=40,60,-20,0,0" diff --git a/tests/kins-params/switchkinscomp/checkresult b/tests/kins-params/switchkinscomp/checkresult new file mode 100755 index 00000000000..b0e4e73565e --- /dev/null +++ b/tests/kins-params/switchkinscomp/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 0 diff --git a/tests/kins-params/switchkinscomp/skip b/tests/kins-params/switchkinscomp/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/switchkinscomp/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/switchkinscomp/test.sh b/tests/kins-params/switchkinscomp/test.sh new file mode 100755 index 00000000000..7884339fba1 --- /dev/null +++ b/tests/kins-params/switchkinscomp/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +. ../lib.sh + +# the stock template: the in-tree build leaves out the shared code, as +# halcompile does, so it runs behind the core that supplies it +CORE=switchkins_core run "switchkinscomp" "" "joints=3 jnt=10,20,30 orient=-" +CORE=switchkins_core run "switchkinscomp" "" "joints=3 jnt=10,20,30" 1 diff --git a/tests/kins-params/test.sh b/tests/kins-params/test.sh deleted file mode 100755 index a81a5f3aabf..00000000000 --- a/tests/kins-params/test.sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/bash -set -e - -halcompile --install paritycheck.c >/dev/null - -# The two templates the way a module built out of tree is: renamed, -# compiled by halcompile on their own, and loaded behind the core that -# supplies the shared code. -sed 's/switchkinscomp/oot_switchkins/g' "$EMC2_HOME/src/hal/components/switchkinscomp.comp" > oot_switchkins.comp -sed 's/userkins/oot_userkins/g' "$EMC2_HOME/src/hal/components/userkins.comp" > oot_userkins.comp -halcompile --install oot_switchkins.comp >/dev/null -halcompile --install oot_userkins.comp >/dev/null -rm -f oot_switchkins.comp oot_userkins.comp - -# One hal file per module. paritycheck evaluates the module in realtime -# through the classic entry points and publishes the answers; check.py -# evaluates it through the non-realtime loader, kinsDescribe() and the -# parameter block, and compares. Where they disagree the module keeps -# state its table does not declare. -# ONLY= in the environment runs the entries for that module alone -run() { - local loadrt="$1" setp="$2" parms="$3" ktype="$4" - local module coords sparm joints frompose pose jnt orient posejoint tool rtparms hal tok - case "$loadrt" in "${ONLY:-}"*) ;; *) return 0 ;; esac - module=${loadrt%% *} - coords=""; sparm="" - for tok in $loadrt; do - case "$tok" in - coordinates=*) coords=${tok#coordinates=} ;; - sparm=*) sparm=${tok#sparm=} ;; - esac - done - joints=3; frompose=0; pose="0,0,0,0,0,0,0,0,0"; jnt="10,20,30,40,50,60,70,80,90" - # the two rotaries that orient the tool, "primary,secondary", or "-" - # where the machine has no such pair and "no-frame" where the module - # reports no tool frame at all, which most of the tree still does - orient="no-frame" - # the rotary whose sign G53.1 P names, the same three ways; where the - # entry gives none, what it gives for the pair - posejoint="" - # a tool offset x,y,z both sides evaluate under, as motion hands it over - tool="-" - for tok in $parms; do - case "$tok" in - joints=*) joints=${tok#joints=} ;; - frompose=*) frompose=${tok#frompose=} ;; - pose=*) pose=${tok#pose=} ;; - jnt=*) jnt=${tok#jnt=} ;; - orient=*) orient=${tok#orient=} ;; - posejoint=*) posejoint=${tok#posejoint=} ;; - tool=*) tool=${tok#tool=} ;; - esac - done - [ -n "$posejoint" ] || posejoint=$orient - # what the module under test is loaded with: everything but our own words - rtparms=$(printf ' %s ' "$parms" | sed 's/ orient=[^ ]*//g; s/ posejoint=[^ ]*//g') - hal=$(mktemp --suffix=.hal) - { if [ -n "${CORE:-}" ]; then printf 'loadrt %s\n' "$CORE"; fi - printf 'loadrt %s\n' "$loadrt" - printf '%s\n' "$setp" - printf 'loadrt paritycheck %s ktype=%s\n' "$rtparms" "${ktype:-0}" - # halcmd keeps quotes, so an absent value travels as a dash - printf 'loadusr -w python3 check.py %s %s %s %s %s %s %s %s %s %s %s\n' \ - "$module" "$joints" "${coords:--}" "${ktype:-0}" "$frompose" "$pose" "$jnt" "${sparm:--}" "$orient" "$posejoint" "$tool" - } > "$hal" - if [ "$tool" = "-" ]; then - echo "=== $loadrt type ${ktype:-0}" - else - echo "=== $loadrt type ${ktype:-0} tool $tool" - fi - halrun -f "$hal" - rm -f "$hal" -} - -# identity, a gantry included -run "trivkins coordinates=XYZ" "" "joints=3 jnt=10,20,30 orient=-" -run "trivkins coordinates=XYZY kinstype=BOTH" "" "joints=4 jnt=10,20,30,20 orient=-" -run "trivkins coordinates=XYZABCUVW" "" "joints=9 orient=-" -run "userkins" "" "joints=3 jnt=10,20,30" -CORE=kins_single_core run "oot_userkins" "" "joints=3 jnt=10,20,30" -CORE=switchkins_core run "oot_switchkins" "" "joints=3 jnt=10,20,30 orient=-" -CORE=switchkins_core run "oot_switchkins" "" "joints=3 jnt=10,20,30" 1 -run "millturn" "" "joints=4 jnt=10,20,30,40 orient=-" -run "millturn" "" "joints=4 jnt=10,20,30,40" 1 - -# linear maps and one rotation -run "corexykins" "" "joints=9" -run "rotatekins" "" "joints=9" -run "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" \ - "joints=9" - -# tables and heads, offsets set so no term drops out -run "maxkins" \ - "setp maxkins.pivot-length 100" \ - "joints=9 jnt=10,20,30,0,15,25,7,0,3 orient=- posejoint=4" - -run "5axiskins coordinates=XYZBCW" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3" -run "5axiskins coordinates=XYZBCW sparm=identityfirst" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3" 1 - -# a table and a head, two primaries: one rotary turns the tool, so no -# pair, and that one names the pose -run "twinspindlekins coordinates=XYZBCW" \ - "setp twinspindlekins.pivot-length 120 -setp twinspindlekins.tool-length 30 -setp twinspindlekins.spindle-distance 400" \ - "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3" -run "twinspindlekins coordinates=XYZBCW" \ - "setp twinspindlekins.pivot-length 120 -setp twinspindlekins.tool-length 30 -setp twinspindlekins.spindle-distance 400" \ - "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3" 1 - -run "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" \ - "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3" - -run "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.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" \ - "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3" - -run "xyzab_tdr_kins" \ - "setp xyzab_tdr_kins.x-offset 3 -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" \ - "joints=5 jnt=10,20,30,15,25 orient=- posejoint=4" 1 - -run "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" \ - "joints=6 jnt=10,20,30,15,25,35 orient=5,4 posejoint=4" 1 - -run "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.pre-rot 0.3 -setp xyzacb_trsrn_kins.primary-angle 20 -setp xyzacb_trsrn_kins.secondary-angle 35" \ - "joints=6 jnt=10,20,30,15,25,35 orient=-" 2 - -run "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" \ - "joints=6 jnt=10,20,30,15,25,35 orient=5,3 posejoint=3" 1 - -# a tool offset across the tool, a tool held off the spindle axis: its X -# and Y turn with the tool frame the module reports, the same in realtime -# and outside it -run "5axiskins coordinates=XYZBCW" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3 tool=4,3,12" -run "5axiskins coordinates=XYZBCW sparm=identityfirst" "" "joints=6 jnt=10,20,30,15,25,5 orient=4,3 posejoint=3 tool=4,3,12" 1 -run "xyzac-trt-kins coordinates=XYZAC" \ - "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" \ - "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3 tool=4,3,7" -run "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" \ - "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3 tool=4,3,7" -run "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" \ - "joints=6 jnt=10,20,30,15,25,35 orient=5,4 posejoint=4 tool=4,3,50" 1 -run "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" \ - "joints=6 jnt=10,20,30,15,25,35 orient=5,3 posejoint=3 tool=4,3,50" 1 -run "twinspindlekins coordinates=XYZBCW" \ - "setp twinspindlekins.pivot-length 120 -setp twinspindlekins.spindle-distance 400" \ - "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3 tool=4,3,30" -run "twinspindlekins coordinates=XYZBCW" \ - "setp twinspindlekins.pivot-length 120 -setp twinspindlekins.spindle-distance 400" \ - "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3 tool=4,3,30" 1 - -# polar -run "rosekins" "" "joints=3 jnt=10,5,30" - -# arms -run "scarakins" "" "joints=6 jnt=30,40,20,10,0,0" -run "scorbot-kins" "" "joints=5 jnt=40,60,-20,0,0" -run "pumakins" "setp pumakins.D6 50" "joints=6 jnt=15,20,-35,10,70,20 orient=-" -run "three21kins" "" "joints=6 jnt=15,20,-35,10,70,20" -run "genserkins" "" "joints=9 jnt=15,20,-35,10,70,20,0,0,0 orient=-" -run "genserkins" "setp genserkins.unrotate-3 1" "joints=9 jnt=15,20,-35,10,70,20,0,0,0 orient=-" - -# parallel machines, from a pose the forward can be seeded with -run "tripodkins" \ - "setp tripodkins.Bx 2 -setp tripodkins.Cx 1 -setp tripodkins.Cy 2" \ - "joints=3 frompose=1 pose=1,1,2" -run "lineardeltakins" "" "joints=9 frompose=1 pose=20,30,-200" -run "rotarydeltakins" "" "joints=9 frompose=1 pose=0,0,-12" -run "genhexkins" "setp genhexkins.screw-lead 0" "joints=6 frompose=1 pose=2,3,20,0,5,-7" -run "genhexkins" "setp genhexkins.screw-lead 5" "joints=6 frompose=1 pose=2,3,20,0,5,-7" -run "pentakins" "" "joints=5 frompose=1 pose=10,20,0,5,-7" diff --git a/tests/kins-params/three21kins/checkresult b/tests/kins-params/three21kins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/three21kins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/three21kins/skip b/tests/kins-params/three21kins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/three21kins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/three21kins/test.sh b/tests/kins-params/three21kins/test.sh new file mode 100755 index 00000000000..28d1050f4c5 --- /dev/null +++ b/tests/kins-params/three21kins/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +. ../lib.sh + +# arms +run "three21kins" "" "joints=6 jnt=15,20,-35,10,70,20" diff --git a/tests/kins-params/tripodkins/checkresult b/tests/kins-params/tripodkins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/tripodkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/tripodkins/skip b/tests/kins-params/tripodkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/tripodkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/tripodkins/test.sh b/tests/kins-params/tripodkins/test.sh new file mode 100755 index 00000000000..1b7066ce744 --- /dev/null +++ b/tests/kins-params/tripodkins/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +. ../lib.sh + +# parallel machines, from a pose the forward can be seeded with +run "tripodkins" \ + "setp tripodkins.Bx 2 +setp tripodkins.Cx 1 +setp tripodkins.Cy 2" \ + "joints=3 frompose=1 pose=1,1,2" diff --git a/tests/kins-params/trivkins/checkresult b/tests/kins-params/trivkins/checkresult new file mode 100755 index 00000000000..64d49d7fc2c --- /dev/null +++ b/tests/kins-params/trivkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 3 0 diff --git a/tests/kins-params/trivkins/skip b/tests/kins-params/trivkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/trivkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/trivkins/test.sh b/tests/kins-params/trivkins/test.sh new file mode 100755 index 00000000000..9fcf4657e12 --- /dev/null +++ b/tests/kins-params/trivkins/test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +. ../lib.sh + +# identity, a gantry included +run "trivkins coordinates=XYZ" "" "joints=3 jnt=10,20,30 orient=-" +run "trivkins coordinates=XYZY kinstype=BOTH" "" "joints=4 jnt=10,20,30,20 orient=-" +run "trivkins coordinates=XYZABCUVW" "" "joints=9 orient=-" diff --git a/tests/kins-params/twinspindlekins/checkresult b/tests/kins-params/twinspindlekins/checkresult new file mode 100755 index 00000000000..8da1c487a9e --- /dev/null +++ b/tests/kins-params/twinspindlekins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 4 2 diff --git a/tests/kins-params/twinspindlekins/skip b/tests/kins-params/twinspindlekins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/twinspindlekins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/twinspindlekins/test.sh b/tests/kins-params/twinspindlekins/test.sh new file mode 100755 index 00000000000..7b0a297c440 --- /dev/null +++ b/tests/kins-params/twinspindlekins/test.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "twinspindlekins coordinates=XYZBCW" \ + "setp twinspindlekins.pivot-length 120 +setp twinspindlekins.tool-length 30 +setp twinspindlekins.spindle-distance 400" \ + "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3" +run "twinspindlekins coordinates=XYZBCW" \ + "setp twinspindlekins.pivot-length 120 +setp twinspindlekins.tool-length 30 +setp twinspindlekins.spindle-distance 400" \ + "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3" 1 + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "twinspindlekins coordinates=XYZBCW" \ + "setp twinspindlekins.pivot-length 120 +setp twinspindlekins.spindle-distance 400" \ + "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3 tool=4,3,30" +run "twinspindlekins coordinates=XYZBCW" \ + "setp twinspindlekins.pivot-length 120 +setp twinspindlekins.spindle-distance 400" \ + "joints=6 jnt=10,20,30,15,25,35 orient=- posejoint=3 tool=4,3,30" 1 diff --git a/tests/kins-params/userkins/checkresult b/tests/kins-params/userkins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/userkins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/userkins/skip b/tests/kins-params/userkins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/userkins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/userkins/test.sh b/tests/kins-params/userkins/test.sh new file mode 100755 index 00000000000..604c17144cb --- /dev/null +++ b/tests/kins-params/userkins/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +. ../lib.sh + +# identity, a gantry included; built as halcompile builds it, the +# template runs behind the core that supplies the shared code +CORE=kins_single_core run "userkins" "" "joints=3 jnt=10,20,30" diff --git a/tests/kins-params/xyzab_tdr_kins/checkresult b/tests/kins-params/xyzab_tdr_kins/checkresult new file mode 100755 index 00000000000..1088e6eb495 --- /dev/null +++ b/tests/kins-params/xyzab_tdr_kins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 1 0 diff --git a/tests/kins-params/xyzab_tdr_kins/skip b/tests/kins-params/xyzab_tdr_kins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/xyzab_tdr_kins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/xyzab_tdr_kins/test.sh b/tests/kins-params/xyzab_tdr_kins/test.sh new file mode 100755 index 00000000000..41773a011ad --- /dev/null +++ b/tests/kins-params/xyzab_tdr_kins/test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "xyzab_tdr_kins" \ + "setp xyzab_tdr_kins.x-offset 3 +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" \ + "joints=5 jnt=10,20,30,15,25 orient=- posejoint=4" 1 diff --git a/tests/kins-params/xyzac-trt-kins/checkresult b/tests/kins-params/xyzac-trt-kins/checkresult new file mode 100755 index 00000000000..cd29c59162e --- /dev/null +++ b/tests/kins-params/xyzac-trt-kins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 1 diff --git a/tests/kins-params/xyzac-trt-kins/skip b/tests/kins-params/xyzac-trt-kins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/xyzac-trt-kins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/xyzac-trt-kins/test.sh b/tests/kins-params/xyzac-trt-kins/test.sh new file mode 100755 index 00000000000..ec5629ea518 --- /dev/null +++ b/tests/kins-params/xyzac-trt-kins/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "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" \ + "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3" + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "xyzac-trt-kins coordinates=XYZAC" \ + "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" \ + "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3 tool=4,3,7" diff --git a/tests/kins-params/xyzacb_trsrn/checkresult b/tests/kins-params/xyzacb_trsrn/checkresult new file mode 100755 index 00000000000..14b580551c5 --- /dev/null +++ b/tests/kins-params/xyzacb_trsrn/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 3 1 diff --git a/tests/kins-params/xyzacb_trsrn/skip b/tests/kins-params/xyzacb_trsrn/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/xyzacb_trsrn/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/xyzacb_trsrn/test.sh b/tests/kins-params/xyzacb_trsrn/test.sh new file mode 100755 index 00000000000..5f2e4c926e3 --- /dev/null +++ b/tests/kins-params/xyzacb_trsrn/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "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" \ + "joints=6 jnt=10,20,30,15,25,35 orient=5,4 posejoint=4" 1 +run "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.pre-rot 0.3 +setp xyzacb_trsrn_kins.primary-angle 20 +setp xyzacb_trsrn_kins.secondary-angle 35" \ + "joints=6 jnt=10,20,30,15,25,35 orient=-" 2 + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "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" \ + "joints=6 jnt=10,20,30,15,25,35 orient=5,4 posejoint=4 tool=4,3,50" 1 diff --git a/tests/kins-params/xyzbc-trt-kins/checkresult b/tests/kins-params/xyzbc-trt-kins/checkresult new file mode 100755 index 00000000000..cd29c59162e --- /dev/null +++ b/tests/kins-params/xyzbc-trt-kins/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 1 diff --git a/tests/kins-params/xyzbc-trt-kins/skip b/tests/kins-params/xyzbc-trt-kins/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/xyzbc-trt-kins/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/xyzbc-trt-kins/test.sh b/tests/kins-params/xyzbc-trt-kins/test.sh new file mode 100755 index 00000000000..ed70611f59a --- /dev/null +++ b/tests/kins-params/xyzbc-trt-kins/test.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "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.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" \ + "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3" + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "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" \ + "joints=5 jnt=10,20,30,15,25 orient=- posejoint=3 tool=4,3,7" diff --git a/tests/kins-params/xyzbca_trsrn/checkresult b/tests/kins-params/xyzbca_trsrn/checkresult new file mode 100755 index 00000000000..cd29c59162e --- /dev/null +++ b/tests/kins-params/xyzbca_trsrn/checkresult @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$(dirname "$0")/../checkresult.sh" "$1" 2 1 diff --git a/tests/kins-params/xyzbca_trsrn/skip b/tests/kins-params/xyzbca_trsrn/skip new file mode 100755 index 00000000000..a12f31a77c2 --- /dev/null +++ b/tests/kins-params/xyzbca_trsrn/skip @@ -0,0 +1,4 @@ +#!/bin/sh +# Builds a realtime component with halcompile, which needs the build +# tools present. Skip when testing installed packages. +[ -z "$SYSTEM_BUILD" ] diff --git a/tests/kins-params/xyzbca_trsrn/test.sh b/tests/kins-params/xyzbca_trsrn/test.sh new file mode 100755 index 00000000000..023248650c3 --- /dev/null +++ b/tests/kins-params/xyzbca_trsrn/test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e +. ../lib.sh + +# a table and a head, two primaries: one rotary turns the tool, so no +# pair, and that one names the pose +run "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" \ + "joints=6 jnt=10,20,30,15,25,35 orient=5,3 posejoint=3" 1 + +# a tool offset across the tool, a tool held off the spindle axis: its X +# and Y turn with the tool frame the module reports, the same in realtime +# and outside it +run "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" \ + "joints=6 jnt=10,20,30,15,25,35 orient=5,3 posejoint=3 tool=4,3,50" 1