aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/homing.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-01-10 11:27:30 -0500
committerKevin O'Connor <kevin@koconnor.net>2025-01-21 18:58:23 -0500
commit4aa550837fc170d0b77a0d461ca4f970b7bee7ae (patch)
tree7a185d949b9179c5f9b3977539e9cfda5ca7756e /klippy/extras/homing.py
parentc72d73ec450119b5fbe13d98409037a21ae97101 (diff)
downloadkutter-4aa550837fc170d0b77a0d461ca4f970b7bee7ae.tar.gz
kutter-4aa550837fc170d0b77a0d461ca4f970b7bee7ae.tar.xz
kutter-4aa550837fc170d0b77a0d461ca4f970b7bee7ae.zip
toolhead: Pass set_position() homing_axes parameter as a string
Use strings such as "xyz" to specify which axes are to be considered homing during a set_position() call. This makes the parameter a little less cryptic. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/homing.py')
-rw-r--r--klippy/extras/homing.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/extras/homing.py b/klippy/extras/homing.py
index bbad5337..add209ec 100644
--- a/klippy/extras/homing.py
+++ b/klippy/extras/homing.py
@@ -187,7 +187,8 @@ class Homing:
# Notify of upcoming homing operation
self.printer.send_event("homing:home_rails_begin", self, rails)
# Alter kinematics class to think printer is at forcepos
- homing_axes = [axis for axis in range(3) if forcepos[axis] is not None]
+ force_axes = [axis for axis in range(3) if forcepos[axis] is not None]
+ homing_axes = "".join(["xyz"[i] for i in force_axes])
startpos = self._fill_coord(forcepos)
homepos = self._fill_coord(movepos)
self.toolhead.set_position(startpos, homing_axes=homing_axes)
@@ -231,7 +232,7 @@ class Homing:
+ self.adjust_pos.get(s.get_name(), 0.))
for s in kin.get_steppers()}
newpos = kin.calc_position(kin_spos)
- for axis in homing_axes:
+ for axis in force_axes:
homepos[axis] = newpos[axis]
self.toolhead.set_position(homepos)