mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-14 10:17:56 -06:00
itersolve: Support setting the stepper position via a cartesian coordinate
Add support for an itersolve_set_position() function that sets a stepper position from a cartesian coordinate. This eliminates the need for both the python and C code to be able to translate from a cartesian coordinate to a stepper position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
0216201cb6
commit
890298d34d
9 changed files with 34 additions and 29 deletions
|
@ -71,9 +71,11 @@ class MCU_stepper:
|
|||
return self._oid
|
||||
def get_step_dist(self):
|
||||
return self._step_dist
|
||||
def set_position(self, pos):
|
||||
self._mcu_position_offset += self.get_commanded_position() - pos
|
||||
self._ffi_lib.itersolve_set_commanded_pos(self._stepper_kinematics, pos)
|
||||
def set_position(self, newpos):
|
||||
orig_cmd_pos = self.get_commanded_position()
|
||||
self._ffi_lib.itersolve_set_position(
|
||||
self._stepper_kinematics, newpos[0], newpos[1], newpos[2])
|
||||
self._mcu_position_offset += orig_cmd_pos - self.get_commanded_position()
|
||||
def get_commanded_position(self):
|
||||
return self._ffi_lib.itersolve_get_commanded_pos(
|
||||
self._stepper_kinematics)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue