diff --git a/docs/src/motion/kinematics-conventions.adoc b/docs/src/motion/kinematics-conventions.adoc index 02446cf425a..f33aa55bf71 100644 --- a/docs/src/motion/kinematics-conventions.adoc +++ b/docs/src/motion/kinematics-conventions.adoc @@ -507,7 +507,7 @@ prefix, so nothing in a config changes. [source,c] ---- static const kins_param_desc fiveaxis_params[] = { - { "pivot-length", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PIVOT_LENGTH }, + { "pivot-length", KINS_PARAM_REAL, KINS_IN, 0, { .r = DEFAULT_PIVOT_LENGTH } }, }; enum { P_PIVOT_LENGTH }; ---- diff --git a/docs/src/motion/switchkins.adoc b/docs/src/motion/switchkins.adoc index edb93924ae2..0cd22360382 100644 --- a/docs/src/motion/switchkins.adoc +++ b/docs/src/motion/switchkins.adoc @@ -705,8 +705,8 @@ and userk ops for the other two: [source,c] ---- static const kins_param_desc my_params[] = { - { "pivot-length", KINS_PARAM_FLOAT, KINS_IN, 0, 100.0 }, - { "tool-offset", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, // the tool length + { "pivot-length", KINS_PARAM_REAL, KINS_IN, 0, { .r = 100.0 } }, + { "tool-offset", KINS_PARAM_REAL, KINS_IN, 1, { .r = 0.0 } }, // the tool length }; enum { P_PIVOT_LENGTH, P_TOOL_OFFSET }; diff --git a/include/kins_module.h b/include/kins_module.h index 13dc8f62411..4e98d3fc050 100644 --- a/include/kins_module.h +++ b/include/kins_module.h @@ -13,6 +13,9 @@ #define __LINUXCNC_KINS_MODULE_H #include "kinematics.h" +#include "rtapi_stdint.h" +#include "rtapi_bool.h" + #ifdef __cplusplus extern "C" { @@ -252,10 +255,10 @@ extern int identityKinematicsJacobian(const double *joint, #define KINS_MAX_TYPES SWITCHKINS_MAX_TYPES typedef enum { - KINS_PARAM_FLOAT = 0, - KINS_PARAM_BIT, - KINS_PARAM_S32, - KINS_PARAM_U32 + KINS_PARAM_REAL = 0, + KINS_PARAM_BOOL, + KINS_PARAM_SINT, + KINS_PARAM_UINT, } kins_param_type; typedef enum { @@ -274,7 +277,15 @@ typedef struct kins_param_desc_tag { kins_param_type type; kins_param_dir dir; int tool; - double dflt; + // Assigning to the dflt union: If '{}' braces are omitted at init + // then the compiler will give a warning 'missing braces' and the + // value is stored as boolean because it is the first in the list. + union { + rtapi_bool b; + rtapi_real r; + rtapi_sint s; + rtapi_uint u; + } dflt; } kins_param_desc; /* The machine, as far as the kinematics is concerned. One copy may be diff --git a/src/emc/kinematics/5axiskins.c b/src/emc/kinematics/5axiskins.c index d1df89d9f36..cebcd9975a4 100644 --- a/src/emc/kinematics/5axiskins.c +++ b/src/emc/kinematics/5axiskins.c @@ -63,8 +63,8 @@ // the geometry, one pin each; the maths reads it from the block static const kins_param_desc fiveaxis_params[] = { - { "pivot-length", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PIVOT_LENGTH }, - { "tool-length", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, + { "pivot-length", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PIVOT_LENGTH} }, + { "tool-length", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, }; enum { P_PIVOT_LENGTH, P_TOOL_LENGTH }; diff --git a/src/emc/kinematics/genhexkins.c b/src/emc/kinematics/genhexkins.c index 45222f0a810..3f6298f3e2e 100644 --- a/src/emc/kinematics/genhexkins.c +++ b/src/emc/kinematics/genhexkins.c @@ -150,19 +150,19 @@ enum { }; #define STRUT_ROWS(i, bx, by, bz, px, py, pz, bnx, bny, bnz, pnx, pny, pnz) \ - { "base." #i ".x", KINS_PARAM_FLOAT, KINS_IN, 0, bx }, \ - { "base." #i ".y", KINS_PARAM_FLOAT, KINS_IN, 0, by }, \ - { "base." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, bz }, \ - { "platform." #i ".x", KINS_PARAM_FLOAT, KINS_IN, 0, px }, \ - { "platform." #i ".y", KINS_PARAM_FLOAT, KINS_IN, 0, py }, \ - { "platform." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, pz }, \ - { "base-n." #i ".x", KINS_PARAM_FLOAT, KINS_IN, 0, bnx }, \ - { "base-n." #i ".y", KINS_PARAM_FLOAT, KINS_IN, 0, bny }, \ - { "base-n." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, bnz }, \ - { "platform-n." #i ".x", KINS_PARAM_FLOAT, KINS_IN, 0, pnx }, \ - { "platform-n." #i ".y", KINS_PARAM_FLOAT, KINS_IN, 0, pny }, \ - { "platform-n." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, pnz }, \ - { "correction." #i, KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 } + { "base." #i ".x", KINS_PARAM_REAL, KINS_IN, 0, {.r=bx} }, \ + { "base." #i ".y", KINS_PARAM_REAL, KINS_IN, 0, {.r=by} }, \ + { "base." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=bz} }, \ + { "platform." #i ".x", KINS_PARAM_REAL, KINS_IN, 0, {.r=px} }, \ + { "platform." #i ".y", KINS_PARAM_REAL, KINS_IN, 0, {.r=py} }, \ + { "platform." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=pz} }, \ + { "base-n." #i ".x", KINS_PARAM_REAL, KINS_IN, 0, {.r=bnx} }, \ + { "base-n." #i ".y", KINS_PARAM_REAL, KINS_IN, 0, {.r=bny} }, \ + { "base-n." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=bnz} }, \ + { "platform-n." #i ".x", KINS_PARAM_REAL, KINS_IN, 0, {.r=pnx} }, \ + { "platform-n." #i ".y", KINS_PARAM_REAL, KINS_IN, 0, {.r=pny} }, \ + { "platform-n." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=pnz} }, \ + { "correction." #i, KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} } static const kins_param_desc genhex_params[P_COUNT] = { STRUT_ROWS(0, DEFAULT_BASE_0_X, DEFAULT_BASE_0_Y, DEFAULT_BASE_0_Z, @@ -189,23 +189,23 @@ static const kins_param_desc genhex_params[P_COUNT] = { DEFAULT_PLATFORM_5_X, DEFAULT_PLATFORM_5_Y, DEFAULT_PLATFORM_5_Z, DEFAULT_BASE_5_NX, DEFAULT_BASE_5_NY, DEFAULT_BASE_5_NZ, DEFAULT_PLATFORM_5_NX, DEFAULT_PLATFORM_5_NY, DEFAULT_PLATFORM_5_NZ), - [P_LAST_ITER] = { "last-iterations", KINS_PARAM_U32, KINS_OUT, 0, 0 }, - [P_MAX_ITER] = { "max-iterations", KINS_PARAM_U32, KINS_OUT, 0, 0 }, - [P_MAX_ERROR] = { "max-error", KINS_PARAM_FLOAT, KINS_IN, 0, 500.0 }, - [P_CONV_CRITERION] = { "convergence-criterion", KINS_PARAM_FLOAT, KINS_IN, 0, 1e-9 }, - [P_ITER_LIMIT] = { "limit-iterations", KINS_PARAM_U32, KINS_IN, 0, 120 }, - [P_TOOL_OFFSET] = { "tool-offset", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, - [P_SPINDLE_OFFSET] = { "spindle-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - [P_SCREW_LEAD] = { "screw-lead", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_SCREW_LEAD }, + [P_LAST_ITER] = { "last-iterations", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, + [P_MAX_ITER] = { "max-iterations", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, + [P_MAX_ERROR] = { "max-error", KINS_PARAM_REAL, KINS_IN, 0, {.r=500.0} }, + [P_CONV_CRITERION] = { "convergence-criterion", KINS_PARAM_REAL, KINS_IN, 0, {.r=1e-9} }, + [P_ITER_LIMIT] = { "limit-iterations", KINS_PARAM_UINT, KINS_IN, 0, {.u=120} }, + [P_TOOL_OFFSET] = { "tool-offset", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, + [P_SPINDLE_OFFSET] = { "spindle-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + [P_SCREW_LEAD] = { "screw-lead", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_SCREW_LEAD} }, // the pose the forward found, for a vismach gui; switchkins provides // the skgui.* pins for the same purpose - [P_GUI_X] = { "x", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_GUI_Y] = { "y", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_GUI_Z] = { "z", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_GUI_A] = { "a", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_GUI_B] = { "b", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_GUI_C] = { "c", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - [P_FWD_FAIL] = { "fwd-kins-fail", KINS_PARAM_BIT, KINS_OUT, 0, 0 }, + [P_GUI_X] = { "x", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_GUI_Y] = { "y", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_GUI_Z] = { "z", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_GUI_A] = { "a", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_GUI_B] = { "b", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_GUI_C] = { "c", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + [P_FWD_FAIL] = { "fwd-kins-fail", KINS_PARAM_BOOL, KINS_OUT, 0, {.b=0} }, }; // the most iterations a converged solution has taken this session, kept diff --git a/src/emc/kinematics/genserfuncs.c b/src/emc/kinematics/genserfuncs.c index b4f4d59fd14..b0173450e14 100644 --- a/src/emc/kinematics/genserfuncs.c +++ b/src/emc/kinematics/genserfuncs.c @@ -68,10 +68,10 @@ enum { }; #define JOINT_ROWS(i, a, alpha, d) \ - { "A-" #i, KINS_PARAM_FLOAT, KINS_IN, 0, a }, \ - { "ALPHA-" #i, KINS_PARAM_FLOAT, KINS_IN, 0, alpha }, \ - { "D-" #i, KINS_PARAM_FLOAT, KINS_IN, 0, d }, \ - { "unrotate-" #i, KINS_PARAM_S32, KINS_IN, 0, 0 } + { "A-" #i, KINS_PARAM_REAL, KINS_IN, 0, {.r=a} }, \ + { "ALPHA-" #i, KINS_PARAM_REAL, KINS_IN, 0, {.r=alpha} }, \ + { "D-" #i, KINS_PARAM_REAL, KINS_IN, 0, {.r=d} }, \ + { "unrotate-" #i, KINS_PARAM_SINT, KINS_IN, 0, {.s=0} } const kins_param_desc GENSER_PARAMS[P_COUNT] = { JOINT_ROWS(0, DEFAULT_A1, DEFAULT_ALPHA1, DEFAULT_D1), @@ -80,8 +80,8 @@ const kins_param_desc GENSER_PARAMS[P_COUNT] = { JOINT_ROWS(3, DEFAULT_A4, DEFAULT_ALPHA4, DEFAULT_D4), JOINT_ROWS(4, DEFAULT_A5, DEFAULT_ALPHA5, DEFAULT_D5), JOINT_ROWS(5, DEFAULT_A6, DEFAULT_ALPHA6, DEFAULT_D6), - [P_LAST_ITER] = { "last-iterations", KINS_PARAM_U32, KINS_OUT, 0, 0 }, - [P_MAX_ITER] = { "max-iterations", KINS_PARAM_U32, KINS_IN, 0, GENSER_DEFAULT_MAX_ITERATIONS }, + [P_LAST_ITER] = { "last-iterations", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, + [P_MAX_ITER] = { "max-iterations", KINS_PARAM_UINT, KINS_IN, 0, {.u=GENSER_DEFAULT_MAX_ITERATIONS} }, }; const int GENSER_NPARAMS = P_COUNT; diff --git a/src/emc/kinematics/kins_util.c b/src/emc/kinematics/kins_util.c index b66b3d9b9e7..f5a5e31c4ab 100644 --- a/src/emc/kinematics/kins_util.c +++ b/src/emc/kinematics/kins_util.c @@ -1532,8 +1532,16 @@ int kinsParamsInit(kins_params *p, return -1; } for (i = 0; i < info->nparams; i++) { - p->geometry[i] = info->params[i].dflt; - if (info->params[i].tool) { p->tool.tran.z = info->params[i].dflt; } + double v; + switch(info->params[i].type) { + case KINS_PARAM_REAL: v = info->params[i].dflt.r; break; + case KINS_PARAM_BOOL: v = info->params[i].dflt.b ? 1.0 : 0.0; break; + case KINS_PARAM_SINT: v = info->params[i].dflt.s; break; + case KINS_PARAM_UINT: v = info->params[i].dflt.u; break; + default: v = 0.0; break; + } + p->geometry[i] = v; + if (info->params[i].tool) { p->tool.tran.z = v; } } return 0; } // kinsParamsInit() @@ -1789,17 +1797,17 @@ int kinsParamsPinsCreate(int comp_id, const char *prefix, const kins_param_desc *d = ¶ms[i]; hal_pdir_t dir = d->dir == KINS_OUT ? HAL_OUT : d->dir == KINS_IO ? HAL_IO : HAL_IN; switch (d->type) { - case KINS_PARAM_FLOAT: - res += hal_pin_new_real(comp_id, dir, &pins[i].r, d->dflt, "%s.%s", prefix, d->name); + case KINS_PARAM_REAL: + res += hal_pin_new_real(comp_id, dir, &pins[i].r, d->dflt.r, "%s.%s", prefix, d->name); break; - case KINS_PARAM_BIT: - res += hal_pin_new_bool(comp_id, dir, &pins[i].b, d->dflt != 0, "%s.%s", prefix, d->name); + case KINS_PARAM_BOOL: + res += hal_pin_new_bool(comp_id, dir, &pins[i].b, d->dflt.b, "%s.%s", prefix, d->name); break; - case KINS_PARAM_S32: - res += hal_pin_new_si32(comp_id, dir, &pins[i].s, (rtapi_s32)d->dflt, "%s.%s", prefix, d->name); + case KINS_PARAM_SINT: + res += hal_pin_new_sint(comp_id, dir, &pins[i].s, d->dflt.s, "%s.%s", prefix, d->name); break; - case KINS_PARAM_U32: - res += hal_pin_new_ui32(comp_id, dir, &pins[i].u, (rtapi_u32)d->dflt, "%s.%s", prefix, d->name); + case KINS_PARAM_UINT: + res += hal_pin_new_uint(comp_id, dir, &pins[i].u, d->dflt.u, "%s.%s", prefix, d->name); break; default: res = -1; @@ -1824,10 +1832,10 @@ void kinsParamsPinsRead(const kins_pin_ref *pins, double v; if (d->dir == KINS_OUT) { continue; } switch (d->type) { - case KINS_PARAM_FLOAT: v = hal_get_real(pins[i].r); break; - case KINS_PARAM_BIT: v = hal_get_bool(pins[i].b) ? 1.0 : 0.0; break; - case KINS_PARAM_S32: v = hal_get_si32(pins[i].s); break; - case KINS_PARAM_U32: v = hal_get_ui32(pins[i].u); break; + case KINS_PARAM_REAL: v = hal_get_real(pins[i].r); break; + case KINS_PARAM_BOOL: v = hal_get_bool(pins[i].b) ? 1.0 : 0.0; break; + case KINS_PARAM_SINT: v = hal_get_sint(pins[i].s); break; + case KINS_PARAM_UINT: v = hal_get_uint(pins[i].u); break; default: v = 0; } p->geometry[i] = v; @@ -1843,12 +1851,26 @@ void kinsParamsPinsWrite(const kins_pin_ref *pins, if (!pins || !params || !s) { return; } for (i = 0; i < nparams && i < KINS_MAX_PARAMS; i++) { const kins_param_desc *d = ¶ms[i]; - if (d->dir != KINS_OUT) { continue; } + if (d->dir != KINS_OUT || isnan(s->out[i])) { continue; } switch (d->type) { - case KINS_PARAM_FLOAT: hal_set_real(pins[i].r, s->out[i]); break; - case KINS_PARAM_BIT: hal_set_bool(pins[i].b, s->out[i] != 0); break; - case KINS_PARAM_S32: hal_set_si32(pins[i].s, (rtapi_s32)s->out[i]); break; - case KINS_PARAM_U32: hal_set_ui32(pins[i].u, (rtapi_u32)s->out[i]); break; + case KINS_PARAM_REAL: hal_set_real(pins[i].r, s->out[i]); break; + case KINS_PARAM_BOOL: hal_set_bool(pins[i].b, s->out[i] != 0.0); break; + case KINS_PARAM_SINT: + if (s->out[i] >= (rtapi_real)RTAPI_SINT_MAX) + hal_set_sint(pins[i].s, RTAPI_SINT_MAX); + else if (s->out[i] <= (rtapi_real)RTAPI_SINT_MIN) + hal_set_sint(pins[i].s, RTAPI_SINT_MIN); + else + hal_set_sint(pins[i].s, (rtapi_sint)s->out[i]); + break; + case KINS_PARAM_UINT: + if (s->out[i] < 0.0) + hal_set_uint(pins[i].u, 0); + else if (s->out[i] >= (rtapi_real)RTAPI_UINT_MAX) + hal_set_uint(pins[i].u, RTAPI_UINT_MAX); + else + hal_set_uint(pins[i].u, s->out[i]); + break; default: break; } } diff --git a/src/emc/kinematics/lineardeltakins.c b/src/emc/kinematics/lineardeltakins.c index d61f3c58ff9..91fdca727cf 100644 --- a/src/emc/kinematics/lineardeltakins.c +++ b/src/emc/kinematics/lineardeltakins.c @@ -25,8 +25,8 @@ // the two lengths, one pin each static const kins_param_desc ld_params[] = { - { "R", KINS_PARAM_FLOAT, KINS_IN, 0, DELTA_RADIUS }, - { "L", KINS_PARAM_FLOAT, KINS_IN, 0, DELTA_DIAGONAL_ROD }, + { "R", KINS_PARAM_REAL, KINS_IN, 0, {.r=DELTA_RADIUS} }, + { "L", KINS_PARAM_REAL, KINS_IN, 0, {.r=DELTA_DIAGONAL_ROD} }, }; enum { P_R, P_L }; diff --git a/src/emc/kinematics/maxkins.c b/src/emc/kinematics/maxkins.c index a32981d12cf..80f6e2c555c 100644 --- a/src/emc/kinematics/maxkins.c +++ b/src/emc/kinematics/maxkins.c @@ -33,9 +33,9 @@ // the geometry, one pin each; the maths reads it from the block static const kins_param_desc max_params[] = { - { "pivot-length", KINS_PARAM_FLOAT, KINS_IO, 0, 0.666 }, - { "conventional-directions", KINS_PARAM_BIT, KINS_IN, 0, 0 }, // default is unconventional - { "tool-length", KINS_PARAM_FLOAT, KINS_IN, 1, 0 }, + { "pivot-length", KINS_PARAM_REAL, KINS_IO, 0, {.r=0.666} }, + { "conventional-directions", KINS_PARAM_BOOL, KINS_IN, 0, {.b=0} }, // default is unconventional + { "tool-length", KINS_PARAM_REAL, KINS_IN, 1, {.r=0} }, }; enum { P_PIVOT_LENGTH, P_CON, P_TOOL_LENGTH }; diff --git a/src/emc/kinematics/pentakins.c b/src/emc/kinematics/pentakins.c index 4be3a0918cf..31acd5cc68a 100644 --- a/src/emc/kinematics/pentakins.c +++ b/src/emc/kinematics/pentakins.c @@ -79,11 +79,11 @@ enum { }; #define STRUT_ROWS(i, bx, by, bz, er, ez) \ - { "base." #i ".x", KINS_PARAM_FLOAT, KINS_IN, 0, bx }, \ - { "base." #i ".y", KINS_PARAM_FLOAT, KINS_IN, 0, by }, \ - { "base." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, bz }, \ - { "effector." #i ".r", KINS_PARAM_FLOAT, KINS_IN, 0, er }, \ - { "effector." #i ".z", KINS_PARAM_FLOAT, KINS_IN, 0, ez } + { "base." #i ".x", KINS_PARAM_REAL, KINS_IN, 0, {.r=bx} }, \ + { "base." #i ".y", KINS_PARAM_REAL, KINS_IN, 0, {.r=by} }, \ + { "base." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=bz} }, \ + { "effector." #i ".r", KINS_PARAM_REAL, KINS_IN, 0, {.r=er} }, \ + { "effector." #i ".z", KINS_PARAM_REAL, KINS_IN, 0, {.r=ez} } static const kins_param_desc penta_params[P_COUNT] = { STRUT_ROWS(0, DEFAULT_BASE_0_X, DEFAULT_BASE_0_Y, DEFAULT_BASE_0_Z, DEFAULT_EFFECTOR_0_R, DEFAULT_EFFECTOR_0_Z), @@ -91,12 +91,12 @@ static const kins_param_desc penta_params[P_COUNT] = { STRUT_ROWS(2, DEFAULT_BASE_2_X, DEFAULT_BASE_2_Y, DEFAULT_BASE_2_Z, DEFAULT_EFFECTOR_2_R, DEFAULT_EFFECTOR_2_Z), STRUT_ROWS(3, DEFAULT_BASE_3_X, DEFAULT_BASE_3_Y, DEFAULT_BASE_3_Z, DEFAULT_EFFECTOR_3_R, DEFAULT_EFFECTOR_3_Z), STRUT_ROWS(4, DEFAULT_BASE_4_X, DEFAULT_BASE_4_Y, DEFAULT_BASE_4_Z, DEFAULT_EFFECTOR_4_R, DEFAULT_EFFECTOR_4_Z), - [P_LAST_ITER] = { "last-iterations", KINS_PARAM_U32, KINS_OUT, 0, 0 }, - [P_MAX_ITER] = { "max-iterations", KINS_PARAM_U32, KINS_OUT, 0, 0 }, - [P_MAX_ERROR] = { "max-error", KINS_PARAM_FLOAT, KINS_IO, 0, 100.0 }, - [P_CONV_CRITERION] = { "convergence-criterion", KINS_PARAM_FLOAT, KINS_IO, 0, 1e-9 }, - [P_ITER_LIMIT] = { "limit-iterations", KINS_PARAM_U32, KINS_IO, 0, 120 }, - [P_TOOL_OFFSET] = { "tool-offset", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, + [P_LAST_ITER] = { "last-iterations", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, + [P_MAX_ITER] = { "max-iterations", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, + [P_MAX_ERROR] = { "max-error", KINS_PARAM_REAL, KINS_IO, 0, {.r=100.0} }, + [P_CONV_CRITERION] = { "convergence-criterion", KINS_PARAM_REAL, KINS_IO, 0, {.r=1e-9} }, + [P_ITER_LIMIT] = { "limit-iterations", KINS_PARAM_UINT, KINS_IO, 0, {.u=120} }, + [P_TOOL_OFFSET] = { "tool-offset", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, }; // the most iterations a converged solution has taken this session, kept diff --git a/src/emc/kinematics/pumakins.c b/src/emc/kinematics/pumakins.c index 220042cc3bf..82b1e2bdd81 100644 --- a/src/emc/kinematics/pumakins.c +++ b/src/emc/kinematics/pumakins.c @@ -27,11 +27,11 @@ // the five dimensions, one pin each; the maths reads them from the block static const kins_param_desc puma_params[] = { - { "A2", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PUMA560_A2 }, - { "A3", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PUMA560_A3 }, - { "D3", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PUMA560_D3 }, - { "D4", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PUMA560_D4 }, - { "D6", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_PUMA560_D6 }, + { "A2", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PUMA560_A2} }, + { "A3", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PUMA560_A3} }, + { "D3", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PUMA560_D3} }, + { "D4", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PUMA560_D4} }, + { "D6", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_PUMA560_D6} }, }; enum { P_A2, P_A3, P_D3, P_D4, P_D6 }; diff --git a/src/emc/kinematics/rosekins.c b/src/emc/kinematics/rosekins.c index 1c807d5c2ce..d1587504d3a 100644 --- a/src/emc/kinematics/rosekins.c +++ b/src/emc/kinematics/rosekins.c @@ -32,9 +32,9 @@ MODULE_LICENSE("GPL"); // the inverse reports the turn count it keeps and the angles it saw static const kins_param_desc rose_params[] = { - { "revolutions", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - { "theta_degrees", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, - { "bigtheta_degrees", KINS_PARAM_FLOAT, KINS_OUT, 0, 0.0 }, + { "revolutions", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + { "theta_degrees", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, + { "bigtheta_degrees", KINS_PARAM_REAL, KINS_OUT, 0, {.r=0.0} }, }; enum { O_REVOLUTIONS, O_THETA, O_BIGTHETA }; diff --git a/src/emc/kinematics/rotarydeltakins.c b/src/emc/kinematics/rotarydeltakins.c index d406406e76d..9de7c45b374 100644 --- a/src/emc/kinematics/rotarydeltakins.c +++ b/src/emc/kinematics/rotarydeltakins.c @@ -26,10 +26,10 @@ // the four lengths, one pin each static const kins_param_desc rd_params[] = { - { "platformradius", KINS_PARAM_FLOAT, KINS_IN, 0, RDELTA_PFR }, - { "thighlength", KINS_PARAM_FLOAT, KINS_IN, 0, RDELTA_TL }, - { "shinlength", KINS_PARAM_FLOAT, KINS_IN, 0, RDELTA_SL }, - { "footradius", KINS_PARAM_FLOAT, KINS_IN, 0, RDELTA_FR }, + { "platformradius", KINS_PARAM_REAL, KINS_IN, 0, {.r=RDELTA_PFR} }, + { "thighlength", KINS_PARAM_REAL, KINS_IN, 0, {.r=RDELTA_TL} }, + { "shinlength", KINS_PARAM_REAL, KINS_IN, 0, {.r=RDELTA_SL} }, + { "footradius", KINS_PARAM_REAL, KINS_IN, 0, {.r=RDELTA_FR} }, }; enum { P_PFR, P_TL, P_SL, P_FR }; diff --git a/src/emc/kinematics/scarakins.c b/src/emc/kinematics/scarakins.c index a416724a5c2..a3340a968c5 100644 --- a/src/emc/kinematics/scarakins.c +++ b/src/emc/kinematics/scarakins.c @@ -68,12 +68,12 @@ // the six dimensions, one pin each; the maths reads them from the block static const kins_param_desc scara_params[] = { - { "D1", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D1 }, - { "D2", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D2 }, - { "D3", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D3 }, - { "D4", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D4 }, - { "D5", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D5 }, - { "D6", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_D6 }, + { "D1", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D1} }, + { "D2", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D2} }, + { "D3", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D3} }, + { "D4", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D4} }, + { "D5", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D5} }, + { "D6", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_D6} }, }; enum { P_D1, P_D2, P_D3, P_D4, P_D5, P_D6 }; diff --git a/src/emc/kinematics/three21kins.c b/src/emc/kinematics/three21kins.c index 438d36ecf0c..a22ed430338 100644 --- a/src/emc/kinematics/three21kins.c +++ b/src/emc/kinematics/three21kins.c @@ -30,14 +30,14 @@ // the eight dimensions, one pin each; the maths reads them from the block static const kins_param_desc three21_params[] = { - { "A1", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_A1 }, - { "A2", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_A2 }, - { "A3", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_A3 }, - { "D1", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_D1 }, - { "D2", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_D2 }, - { "D3", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_D3 }, - { "D4", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_D4 }, - { "D6", KINS_PARAM_FLOAT, KINS_IN, 0, DEFAULT_THREE21_D6 }, + { "A1", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_A1} }, + { "A2", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_A2} }, + { "A3", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_A3} }, + { "D1", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_D1} }, + { "D2", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_D2} }, + { "D3", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_D3} }, + { "D4", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_D4} }, + { "D6", KINS_PARAM_REAL, KINS_IN, 0, {.r=DEFAULT_THREE21_D6} }, }; enum { P_A1, P_A2, P_A3, P_D1, P_D2, P_D3, P_D4, P_D6 }; diff --git a/src/emc/kinematics/tripodkins.c b/src/emc/kinematics/tripodkins.c index 7ce648fc581..2323788eff8 100644 --- a/src/emc/kinematics/tripodkins.c +++ b/src/emc/kinematics/tripodkins.c @@ -72,9 +72,9 @@ // the base geometry, one pin each, poked from HAL as before static const kins_param_desc tripod_params[] = { - { "Bx", KINS_PARAM_FLOAT, KINS_IO, 0, 1.0 }, - { "Cx", KINS_PARAM_FLOAT, KINS_IO, 0, 1.0 }, - { "Cy", KINS_PARAM_FLOAT, KINS_IO, 0, 1.0 }, + { "Bx", KINS_PARAM_REAL, KINS_IO, 0, {.r=1.0} }, + { "Cx", KINS_PARAM_REAL, KINS_IO, 0, {.r=1.0} }, + { "Cy", KINS_PARAM_REAL, KINS_IO, 0, {.r=1.0} }, }; enum { P_BX, P_CX, P_CY }; diff --git a/src/emc/kinematics/trtfuncs.c b/src/emc/kinematics/trtfuncs.c index 4aa6c99a925..2836f9581bf 100644 --- a/src/emc/kinematics/trtfuncs.c +++ b/src/emc/kinematics/trtfuncs.c @@ -42,14 +42,14 @@ // the geometry both machines share, one pin each const kins_param_desc TRT_PARAMS[] = { - { "x-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "x-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "tool-offset", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, - { "conventional-directions", KINS_PARAM_BIT, KINS_IN, 0, 0.0 }, // default: false + { "x-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "x-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "tool-offset", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, + { "conventional-directions", KINS_PARAM_BOOL, KINS_IN, 0, {.b=0} }, // default: false }; const int TRT_NPARAMS = sizeof(TRT_PARAMS)/sizeof(TRT_PARAMS[0]); diff --git a/src/emc/kinematics/userkfuncs.c b/src/emc/kinematics/userkfuncs.c index 2d76ef2fedd..09dd076a0dd 100644 --- a/src/emc/kinematics/userkfuncs.c +++ b/src/emc/kinematics/userkfuncs.c @@ -83,8 +83,8 @@ int userkKinematicsSetup(const int comp_id, if (!udata) goto error; // HAL_IO used to allow resetting demo pins: - res += hal_pin_new_si32(comp_id, HAL_IO, &(udata->fct), 0, "userk.fct"); - res += hal_pin_new_si32(comp_id, HAL_IO, &(udata->ict), 0, "userk.ict"); + res += hal_pin_new_sint(comp_id, HAL_IO, &(udata->fct), 0, "userk.fct"); + res += hal_pin_new_sint(comp_id, HAL_IO, &(udata->ict), 0, "userk.ict"); if (res) goto error; userk_inited = 1; @@ -104,7 +104,7 @@ int userkKinematicsForward(const double *joint, "userkKinematics: not initialized\n"); return -1; } - hal_set_si32(udata->fct, hal_get_si32(udata->fct) + 1); + hal_set_sint(udata->fct, hal_get_sint(udata->fct) + 1); return identityKinematicsForward(joint,world,fflags,iflags); } @@ -113,6 +113,6 @@ int userkKinematicsInverse(const EmcPose * pos, const KINEMATICS_INVERSE_FLAGS * iflags, KINEMATICS_FORWARD_FLAGS * fflags) { - hal_set_si32(udata->ict, hal_get_si32(udata->ict) + 1); + hal_set_sint(udata->ict, hal_get_sint(udata->ict) + 1); return identityKinematicsInverse(pos,joint,iflags,fflags); } diff --git a/src/emc/kinematics_userspace/kinematics_user.c b/src/emc/kinematics_userspace/kinematics_user.c index 92de369697a..24e37b47d52 100644 --- a/src/emc/kinematics_userspace/kinematics_user.c +++ b/src/emc/kinematics_userspace/kinematics_user.c @@ -122,10 +122,10 @@ static int note_pin(KinematicsUserContext *ctx, const char *pin_name, static hal_type_t hal_type_of(kins_param_type t) { switch (t) { - case KINS_PARAM_BIT: return HAL_BOOL; - case KINS_PARAM_S32: return HAL_SINT; - case KINS_PARAM_U32: return HAL_UINT; - default: return HAL_REAL; + case KINS_PARAM_BOOL: return HAL_BOOL; + case KINS_PARAM_SINT: return HAL_SINT; + case KINS_PARAM_UINT: return HAL_UINT; + default: return HAL_REAL; } } diff --git a/src/hal/components/matrixkins.comp b/src/hal/components/matrixkins.comp index ff542cde5d7..6d541317a3f 100644 --- a/src/hal/components/matrixkins.comp +++ b/src/hal/components/matrixkins.comp @@ -185,15 +185,15 @@ license "GPL"; // the calibration matrix, one pin each; the maths reads it from the block static const kins_param_desc matrix_params[] = { - { "C_xx", KINS_PARAM_FLOAT, KINS_IN, 0, 1.0 }, - { "C_xy", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_xz", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_yx", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_yy", KINS_PARAM_FLOAT, KINS_IN, 0, 1.0 }, - { "C_yz", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_zx", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_zy", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "C_zz", KINS_PARAM_FLOAT, KINS_IN, 0, 1.0 }, + { "C_xx", KINS_PARAM_REAL, KINS_IN, 0, {.r=1.0} }, + { "C_xy", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_xz", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_yx", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_yy", KINS_PARAM_REAL, KINS_IN, 0, {.r=1.0} }, + { "C_yz", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_zx", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_zy", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "C_zz", KINS_PARAM_REAL, KINS_IN, 0, {.r=1.0} }, }; enum { C_XX, C_XY, C_XZ, C_YX, C_YY, C_YZ, C_ZX, C_ZY, C_ZZ }; diff --git a/src/hal/components/switchkinscomp.comp b/src/hal/components/switchkinscomp.comp index 4550d7d1fb4..d4d9b448f3d 100644 --- a/src/hal/components/switchkinscomp.comp +++ b/src/hal/components/switchkinscomp.comp @@ -83,7 +83,7 @@ RTAPI_MP_STRING(coordinates, "Axes-to-joints-ordering"); // need; an entry flagged as the tool arrives in p->tool.tran.z as well. static const kins_param_desc my_params[] = { - { "x-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, + { "x-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, }; enum { P_X_OFFSET }; diff --git a/src/hal/components/userkins.comp b/src/hal/components/userkins.comp index 263aee5a86a..aab96ac010a 100644 --- a/src/hal/components/userkins.comp +++ b/src/hal/components/userkins.comp @@ -88,8 +88,8 @@ author "Dewey Garrett"; // (written from s->out[] after it), or an input that can be poked // (KINS_IO). The example pair below echoes 'in' to 'out'. static const kins_param_desc userkins_params[] = { - { "in", KINS_PARAM_U32, KINS_IN, 0, 0 }, - { "out", KINS_PARAM_U32, KINS_OUT, 0, 0 }, + { "in", KINS_PARAM_UINT, KINS_IN, 0, {.u=0} }, + { "out", KINS_PARAM_UINT, KINS_OUT, 0, {.u=0} }, }; enum { P_IN, P_OUT }; diff --git a/src/hal/components/xyzab_tdr_kins.comp b/src/hal/components/xyzab_tdr_kins.comp index 0444c68e1d1..b8b7bbeeab9 100644 --- a/src/hal/components/xyzab_tdr_kins.comp +++ b/src/hal/components/xyzab_tdr_kins.comp @@ -47,12 +47,12 @@ RTAPI_MP_STRING(coordinates, "Axes-to-joints-ordering"); // the geometry, one pin each; the maths reads it from the block (see // kins_module.h), and the tool length from p->tool.tran.z static const kins_param_desc tdr_params[] = { - { "tool-offset-z", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, - { "x-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "x-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-rot-point", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, + { "tool-offset-z", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, + { "x-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "x-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-rot-point", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, }; enum { P_TOOL, P_XO, P_ZO, P_XR, P_YR, P_ZR }; diff --git a/src/hal/components/xyzacb_trsrn.comp b/src/hal/components/xyzacb_trsrn.comp index 2ee44e38849..b3e131d18c4 100644 --- a/src/hal/components/xyzacb_trsrn.comp +++ b/src/hal/components/xyzacb_trsrn.comp @@ -31,17 +31,17 @@ RTAPI_MP_STRING(coordinates, "Axes-to-joints-ordering"); // pins are what the TOOL kinematics uses in place of the head joints: // the remap writes them. static const kins_param_desc trsrn_params[] = { - { "tool-offset-z", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, - { "y-pivot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-pivot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "x-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-rot-axis", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-rot-axis", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "pre-rot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "nut-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "primary-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "secondary-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, + { "tool-offset-z", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, + { "y-pivot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-pivot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "x-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-rot-axis", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-rot-axis", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "pre-rot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "nut-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "primary-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "secondary-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, }; enum { P_TOOL, P_PIVOT, P_ZPIVOT, P_XO, P_YO, P_ROT_AXIS, P_ZROT_AXIS, P_PRE_ROT, P_NUT, P_PRIM, P_SEC }; diff --git a/src/hal/components/xyzbca_trsrn.comp b/src/hal/components/xyzbca_trsrn.comp index f914794a1f4..56a8e21bc45 100644 --- a/src/hal/components/xyzbca_trsrn.comp +++ b/src/hal/components/xyzbca_trsrn.comp @@ -31,17 +31,17 @@ RTAPI_MP_STRING(coordinates, "Axes-to-joints-ordering"); // pins are what the TOOL kinematics uses in place of the head joints: // the remap writes them. static const kins_param_desc trsrn_params[] = { - { "tool-offset-z", KINS_PARAM_FLOAT, KINS_IN, 1, 0.0 }, - { "x-pivot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-pivot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "x-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "y-offset", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "x-rot-axis", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "z-rot-axis", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "pre-rot", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "nut-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "primary-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, - { "secondary-angle", KINS_PARAM_FLOAT, KINS_IN, 0, 0.0 }, + { "tool-offset-z", KINS_PARAM_REAL, KINS_IN, 1, {.r=0.0} }, + { "x-pivot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-pivot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "x-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "y-offset", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "x-rot-axis", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "z-rot-axis", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "pre-rot", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "nut-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "primary-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, + { "secondary-angle", KINS_PARAM_REAL, KINS_IN, 0, {.r=0.0} }, }; enum { P_TOOL, P_PIVOT, P_ZPIVOT, P_XO, P_YO, P_ROT_AXIS, P_ZROT_AXIS, P_PRE_ROT, P_NUT, P_PRIM, P_SEC };