mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 23:24:01 -06:00
stepper: Remove set_tag_position() code
Have callers store the stepper positions in a dict. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
77bc5e4388
commit
c0d860487a
17 changed files with 62 additions and 66 deletions
|
@ -29,10 +29,10 @@ class WinchKinematics:
|
|||
self.set_position([0., 0., 0.], ())
|
||||
def get_steppers(self):
|
||||
return list(self.steppers)
|
||||
def calc_tag_position(self):
|
||||
def calc_position(self, stepper_positions):
|
||||
# Use only first three steppers to calculate cartesian position
|
||||
spos = [s.get_tag_position() for s in self.steppers[:3]]
|
||||
return mathutil.trilateration(self.anchors[:3], [sp*sp for sp in spos])
|
||||
pos = [stepper_positions[rail.get_name()] for rail in self.steppers[:3]]
|
||||
return mathutil.trilateration(self.anchors[:3], [sp*sp for sp in pos])
|
||||
def set_position(self, newpos, homing_axes):
|
||||
for s in self.steppers:
|
||||
s.set_position(newpos)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue