toolhead: Add a manual_move() helper function

Add a helper function for submitting relative movements.  This
function will also automatically ensure gcode.reset_last_position() is
called.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-08-16 22:43:03 -04:00
parent b9ac6d6306
commit 2caaaea9a4
6 changed files with 34 additions and 55 deletions

View File

@@ -93,11 +93,10 @@ class ManualProbeHelper:
def move_z(self, z_pos):
curpos = self.toolhead.get_position()
try:
if curpos[2] - z_pos < Z_BOB_MINIMUM:
curpos[2] = z_pos + Z_BOB_MINIMUM
self.toolhead.move(curpos, self.speed)
curpos[2] = z_pos
self.toolhead.move(curpos, self.speed)
z_bob_pos = z_pos + Z_BOB_MINIMUM
if curpos[2] < z_bob_pos:
self.toolhead.manual_move([None, None, z_bob_pos], self.speed)
self.toolhead.manual_move([None, None, z_pos], self.speed)
except homing.CommandError as e:
self.finalize(False)
raise