diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-06-22 13:03:07 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-06-22 14:09:01 -0400 |
commit | 890298d34d76923e895ff7905b9dbe374035e694 (patch) | |
tree | cdc5590ef88c62b76f5fb0543c12d2cbe267edf2 /klippy/corexy.py | |
parent | 0216201cb6b9b486a75e446ca1cb2bbd18f329d7 (diff) | |
download | kutter-890298d34d76923e895ff7905b9dbe374035e694.tar.gz kutter-890298d34d76923e895ff7905b9dbe374035e694.tar.xz kutter-890298d34d76923e895ff7905b9dbe374035e694.zip |
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>
Diffstat (limited to 'klippy/corexy.py')
-rw-r--r-- | klippy/corexy.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/klippy/corexy.py b/klippy/corexy.py index 773b46d6..511e8fe3 100644 --- a/klippy/corexy.py +++ b/klippy/corexy.py @@ -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): |