Skip to content
Merged
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: 2 additions & 0 deletions src/emc/task/emctaskmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ void readahead_reading(void)
emcStatus->task.execState ==
EMC_TASK_EXEC::DONE) {
emcTaskPlanClearWait();
goto interpret_again;
}
} else {
readRetval = emcTaskPlanRead();
Expand Down Expand Up @@ -2876,6 +2877,7 @@ static int emcTaskExecute(void)
emcStatus->motion.traj.switchkins_changed = false;
emcTaskPlanSynch();
emcStatus->task.execState = EMC_TASK_EXEC::DONE;
emcTaskEager = 1;
}
break;
}
Expand Down
24 changes: 10 additions & 14 deletions tests/kins-switch/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def mdi(cmd):
c.auto(linuxcnc.AUTO_RUN, 0)

said = []
seen = [kins_type()]
at_switch = None
strayed = [0.0] * JOINTS
w_reached = 0.0
Expand All @@ -79,10 +78,8 @@ def mdi(cmd):
s.poll()
now = joints()
k = kins_type()
if k != seen[-1]:
seen.append(k)
if k == 1 and at_switch is None:
at_switch = now
if k == 1 and at_switch is None:
at_switch = now
if k == 1 and at_switch is not None:
for j in CARRIED:
strayed[j] = max(strayed[j], abs(now[j] - at_switch[j]))
Expand Down Expand Up @@ -112,19 +109,18 @@ def mdi(cmd):
print("W ran to %.4f, the other joints held to %.2e"
% (w_reached, max(strayed[j] for j in CARRIED)))

# the abort routine's G13.1 fires at estop reset, so the machine may stand
# in identity (1) already when the program starts; either way the program
# itself walks 0, 1, 0, 1
# the program walks 0, 1, 0, 1 and the line after each selection reports
# what the interpreter holds and what motion runs; the pin read there is
# the check that the selection went through before the next line, which
# no sampler on this side could make (a selection undone on the next
# line holds for one servo period)
want = [0, 1, 0, 1]
if seen[-4:] != want:
error("motion.kins-type went %s, not ...%s" % (seen, want))

reported = [m[1].strip() for m in said if m[1].strip().startswith("KINSTYPE=")]
want_reported = ["KINSTYPE=%d.000000" % k for k in want]
want_reported = ["KINSTYPE=%d.000000 PIN=%d.000000" % (k, k) for k in want]
if reported != want_reported:
error("#<_kins_type> reported %s" % (reported,))
error("the lines after the selections reported %s" % (reported,))
else:
print("#<_kins_type> reported %s" % " ".join(reported))
print("the lines after the selections reported %s" % " | ".join(reported))

# ---- a negative kinematics number is refused -----------------------------

Expand Down
12 changes: 7 additions & 5 deletions tests/kins-switch/test.ngc
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
; never assume the startup kinematics: the abort routine's G13.1 leaves
; the machine in identity
; the machine in identity. The line after each selection reads the
; kinematics motion runs, motion.kins-type, next to the interpreter's:
; a selection is a queue buster, so the next line sees it switched
g12.1 p0
; a pose the two kinematics disagree about: the tilt folds the pivot into
; the joints that carry X, Y and Z, so the joints are not the axis values
g0 x10 y10 z-5 b-22.5 c45
(debug, KINSTYPE=#<_kins_type>)
(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>)
g12.1 p1
(debug, KINSTYPE=#<_kins_type>)
(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>)
; identity kinematics: W is joint 5 alone, so nothing else may move
g1 w10 f1000
; the dwell ends the stroke on its endpoint instead of blending past it
g4 p0.1
g0 w0
; numeric selection puts back the kinematics the program started in
g12.1 p0
(debug, KINSTYPE=#<_kins_type>)
(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>)
; and G13.1 cancels to identity, which on this module is kinematics 1:
; it is the flag that decides, not the number
g13.1
(debug, KINSTYPE=#<_kins_type>)
(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>)
m2
Loading