Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/motion/kinematics-conventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
----
Expand Down
4 changes: 2 additions & 2 deletions docs/src/motion/switchkins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
21 changes: 16 additions & 5 deletions include/kins_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#define __LINUXCNC_KINS_MODULE_H

#include "kinematics.h"
#include "rtapi_stdint.h"
#include "rtapi_bool.h"


#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/emc/kinematics/5axiskins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
56 changes: 28 additions & 28 deletions src/emc/kinematics/genhexkins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/emc/kinematics/genserfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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;

Expand Down
60 changes: 41 additions & 19 deletions src/emc/kinematics/kins_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1789,17 +1797,17 @@ int kinsParamsPinsCreate(int comp_id, const char *prefix,
const kins_param_desc *d = &params[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;
Expand All @@ -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;
Expand All @@ -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 = &params[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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/emc/kinematics/lineardeltakins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
6 changes: 3 additions & 3 deletions src/emc/kinematics/maxkins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
22 changes: 11 additions & 11 deletions src/emc/kinematics/pentakins.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ 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),
STRUT_ROWS(1, DEFAULT_BASE_1_X, DEFAULT_BASE_1_Y, DEFAULT_BASE_1_Z, DEFAULT_EFFECTOR_1_R, DEFAULT_EFFECTOR_1_Z),
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
Expand Down
10 changes: 5 additions & 5 deletions src/emc/kinematics/pumakins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
6 changes: 3 additions & 3 deletions src/emc/kinematics/rosekins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
8 changes: 4 additions & 4 deletions src/emc/kinematics/rotarydeltakins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
Loading
Loading