Skip to content

Commit 9d5570c

Browse files
committed
Fix homing bug when trying to home while a homing sequence is already in progress
Fixes LinuxCNC#3314 The modification to 'command.c' prevents the homing process breaking where the joint would continue moving indefinitely. The modifications to axis.py and gmoccapy.py prevents the gui freezing that occurs due to wait_complete() timing out to the default 5 seconds.
1 parent 6f21db8 commit 9d5570c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/emc/motion/command.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,10 @@ void emcmotCommandHandler_locked(void *arg, long servo_period)
13631363
joint_num);
13641364
return;
13651365
}
1366-
1366+
if ( get_homing_is_active() ) {
1367+
reportError("Homing not possible until current homing process is finished.\n");
1368+
return;
1369+
}
13671370
if (!GET_MOTION_ENABLE_FLAG()) {
13681371
break;
13691372
}

src/emc/usr_intf/axis/scripts/axis.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,6 +1949,11 @@ def all_homed():
19491949
return isHomed
19501950

19511951
def go_home(num):
1952+
s.poll()
1953+
for j in range(s.joints):
1954+
if s.joint[j]["homing"]:
1955+
print(_("Homing not possible until current homing process is finished."))
1956+
return
19521957
set_motion_teleop(0)
19531958
c.home(num)
19541959
c.wait_complete()

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4016,6 +4016,11 @@ def _on_btn_home_back_clicked(self, widget):
40164016
def _on_btn_home_clicked(self, widget):
40174017
# home axis or joint?
40184018
LOG.debug("on button home clicked = {0}".format(widget.get_property("name")))
4019+
self.stat.poll()
4020+
for j in range(self.stat.joints):
4021+
if self.stat.joint[j]["homing"]:
4022+
self._show_error((13, _("Homing not possible until current homing process is finished.")))
4023+
return
40194024
if "axis" in widget.get_property("name"):
40204025
value = widget.get_property("name")[-1]
40214026
# now get the joint from directory by the value

0 commit comments

Comments
 (0)