mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 23:24:01 -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
|
@ -46,10 +46,8 @@ class CoreXYKinematics:
|
|||
pos = [rail.get_commanded_position() for rail in self.rails]
|
||||
return [0.5 * (pos[0] + pos[1]), 0.5 * (pos[0] - pos[1]), pos[2]]
|
||||
def set_position(self, newpos, homing_axes):
|
||||
pos = (newpos[0] + newpos[1], newpos[0] - newpos[1], newpos[2])
|
||||
for i in StepList:
|
||||
rail = self.rails[i]
|
||||
rail.set_position(pos[i])
|
||||
for i, rail in enumerate(self.rails):
|
||||
rail.set_position(newpos)
|
||||
if i in homing_axes:
|
||||
self.limits[i] = rail.get_range()
|
||||
def home(self, homing_state):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue